{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/9515","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/9515/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/9515/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/9515/events","html_url":"https://github.com/JuliaLang/julia/issues/9515","id":53170169,"number":9515,"title":"Why don't array comprehensions desugar into map?","user":{"login":"samuela","id":226872,"avatar_url":"https://avatars.githubusercontent.com/u/226872?v=3","gravatar_id":"","url":"https://api.github.com/users/samuela","html_url":"https://github.com/samuela","followers_url":"https://api.github.com/users/samuela/followers","following_url":"https://api.github.com/users/samuela/following{/other_user}","gists_url":"https://api.github.com/users/samuela/gists{/gist_id}","starred_url":"https://api.github.com/users/samuela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samuela/subscriptions","organizations_url":"https://api.github.com/users/samuela/orgs","repos_url":"https://api.github.com/users/samuela/repos","events_url":"https://api.github.com/users/samuela/events{/privacy}","received_events_url":"https://api.github.com/users/samuela/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/JuliaLang/julia/labels/speculative","name":"speculative","color":"999999"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2014-12-31T06:36:48Z","updated_at":"2015-01-02T16:16:45Z","closed_at":"2015-01-02T16:16:45Z","body":"I discovered this fact while working with something like the following:\r\n\r\n```julia\r\njulia> da = distribute(1:10)\r\n10-element DArray{Int64,1,UnitRange{Int64}}:\r\n  1\r\n  2\r\n  3\r\n  4\r\n  5\r\n  6\r\n  7\r\n  8\r\n  9\r\n 10\r\n\r\njulia> [println((myid(), x)) for x in da];\r\n(1,1)\r\n(1,2)\r\n(1,3)\r\n(1,4)\r\n(1,5)\r\n(1,6)\r\n(1,7)\r\n(1,8)\r\n(1,9)\r\n(1,10)\r\n\r\njulia> map((x) -> println((myid(), x)), da);\r\n\tFrom worker 2:\t(2,1)\r\n\tFrom worker 3:\t(3,6)\r\n\tFrom worker 2:\t(2,2)\r\n\tFrom worker 2:\t(2,3)\r\n\tFrom worker 2:\t(2,4)\r\n\tFrom worker 2:\t(2,5)\r\n\tFrom worker 3:\t(3,7)\r\n\tFrom worker 3:\t(3,8)\r\n\tFrom worker 3:\t(3,9)\r\n\tFrom worker 3:\t(3,10)\r\n```\r\n\r\nWhich raises the obvious question: why don't array comprehensions simply desugar into `map`s? This smells of bad language design that apparently identical language features have subtly different semantics."},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/68538315","html_url":"https://github.com/JuliaLang/julia/issues/9515#issuecomment-68538315","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/9515","id":68538315,"user":{"login":"JeffBezanson","id":744556,"avatar_url":"https://avatars.githubusercontent.com/u/744556?v=3","gravatar_id":"","url":"https://api.github.com/users/JeffBezanson","html_url":"https://github.com/JeffBezanson","followers_url":"https://api.github.com/users/JeffBezanson/followers","following_url":"https://api.github.com/users/JeffBezanson/following{/other_user}","gists_url":"https://api.github.com/users/JeffBezanson/gists{/gist_id}","starred_url":"https://api.github.com/users/JeffBezanson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JeffBezanson/subscriptions","organizations_url":"https://api.github.com/users/JeffBezanson/orgs","repos_url":"https://api.github.com/users/JeffBezanson/repos","events_url":"https://api.github.com/users/JeffBezanson/events{/privacy}","received_events_url":"https://api.github.com/users/JeffBezanson/received_events","type":"User","site_admin":false},"created_at":"2015-01-02T16:16:45Z","updated_at":"2015-01-02T16:16:45Z","body":"There are several issues about redesigning comprehensions, so I'm going to close this one as it's more just a discussion."}}