{"action":"created","issue":{"url":"https://api.github.com/repos/ash-lang/ash/issues/37","labels_url":"https://api.github.com/repos/ash-lang/ash/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/ash-lang/ash/issues/37/comments","events_url":"https://api.github.com/repos/ash-lang/ash/issues/37/events","html_url":"https://github.com/ash-lang/ash/issues/37","id":97012195,"number":37,"title":"Array, HashMap and List initialisation syntax","user":{"login":"SamTebbs33","id":1929466,"avatar_url":"https://avatars.githubusercontent.com/u/1929466?v=3","gravatar_id":"","url":"https://api.github.com/users/SamTebbs33","html_url":"https://github.com/SamTebbs33","followers_url":"https://api.github.com/users/SamTebbs33/followers","following_url":"https://api.github.com/users/SamTebbs33/following{/other_user}","gists_url":"https://api.github.com/users/SamTebbs33/gists{/gist_id}","starred_url":"https://api.github.com/users/SamTebbs33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamTebbs33/subscriptions","organizations_url":"https://api.github.com/users/SamTebbs33/orgs","repos_url":"https://api.github.com/users/SamTebbs33/repos","events_url":"https://api.github.com/users/SamTebbs33/events{/privacy}","received_events_url":"https://api.github.com/users/SamTebbs33/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ash-lang/ash/labels/analysis","name":"analysis","color":"eb6420"},{"url":"https://api.github.com/repos/ash-lang/ash/labels/code-gen","name":"code-gen","color":"0052cc"},{"url":"https://api.github.com/repos/ash-lang/ash/labels/grammar","name":"grammar","color":"5319e7"},{"url":"https://api.github.com/repos/ash-lang/ash/labels/proposal","name":"proposal","color":"006b75"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-24T09:25:27Z","updated_at":"2015-07-24T17:03:30Z","closed_at":"2015-07-24T17:03:30Z","body":"# Arrays\r\nArray initialisation syntax should be changed to\r\n\r\n```\r\nvar array = [1, 2, 3, 4] // Static initialisation\r\nvar array2 = new [int, 10] // Initialised with a type an size\r\n```\r\nThis would then free up the `{` and `}` characters for use with list initialisation\r\n\r\n# Lists\r\n```\r\nvar list = {1, 2, 3} // Static initialisation, Inferred as List<Integer>\r\nvar = new {Integer, 10} // A list initialised with a type and a size\r\n```\r\n\r\nThe type of list that should be instantiated when using the list syntax is under consideration, proposals are as follows:\r\n* When using static initialisation, the type of list should be inferred as `LinkedList` as this is the most commonly used list type.\r\n* When using the second type of initialisation, if a size is included then an `ArrayList` should be instantiated, otherwise a `LinkedList` is used.\r\n\r\n# HashMaps\r\nHashMap initialisation could be achieved with braces but with colons separating keys and values.\r\n\r\n```\r\nvar hashMap = {\"key1\" : \"val1\", \"key2\" : \"val2\"} // Inferred as HashMap<String, String>\r\nvar val1 = hashMap[\"key1\"]\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/ash-lang/ash/issues/comments/124580413","html_url":"https://github.com/ash-lang/ash/issues/37#issuecomment-124580413","issue_url":"https://api.github.com/repos/ash-lang/ash/issues/37","id":124580413,"user":{"login":"SamTebbs33","id":1929466,"avatar_url":"https://avatars.githubusercontent.com/u/1929466?v=3","gravatar_id":"","url":"https://api.github.com/users/SamTebbs33","html_url":"https://github.com/SamTebbs33","followers_url":"https://api.github.com/users/SamTebbs33/followers","following_url":"https://api.github.com/users/SamTebbs33/following{/other_user}","gists_url":"https://api.github.com/users/SamTebbs33/gists{/gist_id}","starred_url":"https://api.github.com/users/SamTebbs33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamTebbs33/subscriptions","organizations_url":"https://api.github.com/users/SamTebbs33/orgs","repos_url":"https://api.github.com/users/SamTebbs33/repos","events_url":"https://api.github.com/users/SamTebbs33/events{/privacy}","received_events_url":"https://api.github.com/users/SamTebbs33/received_events","type":"User","site_admin":false},"created_at":"2015-07-24T17:03:30Z","updated_at":"2015-07-24T17:03:30Z","body":"Closed by 3667f2a"}}