{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/27772","repository_url":"https://api.github.com/repos/JuliaLang/julia","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/27772/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/27772/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/27772/events","html_url":"https://github.com/JuliaLang/julia/pull/27772","id":335465370,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk3MTU3NzMx","number":27772,"title":"Zero-dimensional arrays FAQ","user":{"login":"cossio","id":10637482,"node_id":"MDQ6VXNlcjEwNjM3NDgy","avatar_url":"https://avatars2.githubusercontent.com/u/10637482?v=4","gravatar_id":"","url":"https://api.github.com/users/cossio","html_url":"https://github.com/cossio","followers_url":"https://api.github.com/users/cossio/followers","following_url":"https://api.github.com/users/cossio/following{/other_user}","gists_url":"https://api.github.com/users/cossio/gists{/gist_id}","starred_url":"https://api.github.com/users/cossio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cossio/subscriptions","organizations_url":"https://api.github.com/users/cossio/orgs","repos_url":"https://api.github.com/users/cossio/repos","events_url":"https://api.github.com/users/cossio/events{/privacy}","received_events_url":"https://api.github.com/users/cossio/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-06-25T15:48:36Z","updated_at":"2018-06-25T19:51:41Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/27772","html_url":"https://github.com/JuliaLang/julia/pull/27772","diff_url":"https://github.com/JuliaLang/julia/pull/27772.diff","patch_url":"https://github.com/JuliaLang/julia/pull/27772.patch"},"body":"Adding some documentation about zero-dimensional arrays. Some discussion on Slack:\r\n\r\nhttps://julialang.slack.com/archives/C6GHSTN4T/p1529875426000022\r\n\r\nI copied/pasted some comments by more knowledgeable people, with minor edits.\r\n\r\nQuestions about 0-dimensional arrays arise often. And I think they are a bit unintuitive. Some documentation might help.\r\n\r\nhttps://discourse.julialang.org/t/what-is-the-reason-for-a-zero-dimensional-array/7175\r\n\r\nhttps://discourse.julialang.org/t/why-have-0-dimensional-arrays/797\r\n\r\nHopefully this clarifies the concept for others as well.\r\n\r\nSupersedes https://github.com/JuliaLang/julia/pull/27765."},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/400074012","html_url":"https://github.com/JuliaLang/julia/pull/27772#issuecomment-400074012","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/27772","id":400074012,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMDA3NDAxMg==","user":{"login":"mbauman","id":154641,"node_id":"MDQ6VXNlcjE1NDY0MQ==","avatar_url":"https://avatars0.githubusercontent.com/u/154641?v=4","gravatar_id":"","url":"https://api.github.com/users/mbauman","html_url":"https://github.com/mbauman","followers_url":"https://api.github.com/users/mbauman/followers","following_url":"https://api.github.com/users/mbauman/following{/other_user}","gists_url":"https://api.github.com/users/mbauman/gists{/gist_id}","starred_url":"https://api.github.com/users/mbauman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbauman/subscriptions","organizations_url":"https://api.github.com/users/mbauman/orgs","repos_url":"https://api.github.com/users/mbauman/repos","events_url":"https://api.github.com/users/mbauman/events{/privacy}","received_events_url":"https://api.github.com/users/mbauman/received_events","type":"User","site_admin":false},"created_at":"2018-06-25T19:51:41Z","updated_at":"2018-06-25T19:51:41Z","author_association":"MEMBER","body":"Well, ideally Refs would also implement all the methods to make them behave largely like 0-dimensional arrays themselves (#26988).  But, I think you're right — typically folks don't need or run into them, which is precisely why they cause confusion when it does occur, and which is why it's nice to have it as a FAQ instead of a part of the narrative manual.  They do mostly just \"fall out\" of an implementation in a consistent manner; a good example is `view(A, 1)` which provides a view into the first element of an array.  Returning an unwrapped scalar would no longer be a view. I'd wager they're most likely obtained by accidentally forgetting args in `zeros()` or `Array{Int}(undef)` or some such.  \r\n\r\nWe could perhaps emphasize further the fact that 0-dimensional arrays are first and foremost _containers_ and do not behave like the element they wrap.  Furthermore, I had been also thinking about calling out the fact that we do not allow 0-dimensional arrays to participate in the linear algebra of matrices.  Thus, while you can broadcast `rand(3,3) .* fill(2)`, we have not defined the multiplication `rand(3,3) * fill(2)`.\r\n\r\nJust checking in here: how you doing, @cossio?  Getting revision fatigue yet?  Let us know before you get too frustrated with us. I know incremental reviews can be a challenge.  :)"}}
{"actor":{"display_login":"mbauman"}}