{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/JSON.jl/issues/93","labels_url":"https://api.github.com/repos/JuliaLang/JSON.jl/issues/93/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/JSON.jl/issues/93/comments","events_url":"https://api.github.com/repos/JuliaLang/JSON.jl/issues/93/events","html_url":"https://github.com/JuliaLang/JSON.jl/issues/93","id":57694912,"number":93,"title":"question: JSON.json(array)","user":{"login":"EricForgy","id":8954730,"avatar_url":"https://avatars.githubusercontent.com/u/8954730?v=3","gravatar_id":"","url":"https://api.github.com/users/EricForgy","html_url":"https://github.com/EricForgy","followers_url":"https://api.github.com/users/EricForgy/followers","following_url":"https://api.github.com/users/EricForgy/following{/other_user}","gists_url":"https://api.github.com/users/EricForgy/gists{/gist_id}","starred_url":"https://api.github.com/users/EricForgy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EricForgy/subscriptions","organizations_url":"https://api.github.com/users/EricForgy/orgs","repos_url":"https://api.github.com/users/EricForgy/repos","events_url":"https://api.github.com/users/EricForgy/events{/privacy}","received_events_url":"https://api.github.com/users/EricForgy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-14T14:37:44Z","updated_at":"2015-02-15T08:16:08Z","closed_at":null,"body":"julia> a = [[1 2 3],[4 5 6]]\r\n2x3 Array{Int64,2}:\r\n 1  2  3\r\n 4  5  6\r\n\r\njulia> JSON.json(a)\r\n\"[[1,4],[2,5],[3,6]]\"\r\n\r\nI would expect: \"[[1,2,3],[4,5,6]]\".\r\n\r\nI'm running version 0.3.3. \r\n"},"comment":{"url":"https://api.github.com/repos/JuliaLang/JSON.jl/issues/comments/74408469","html_url":"https://github.com/JuliaLang/JSON.jl/issues/93#issuecomment-74408469","issue_url":"https://api.github.com/repos/JuliaLang/JSON.jl/issues/93","id":74408469,"user":{"login":"EricForgy","id":8954730,"avatar_url":"https://avatars.githubusercontent.com/u/8954730?v=3","gravatar_id":"","url":"https://api.github.com/users/EricForgy","html_url":"https://github.com/EricForgy","followers_url":"https://api.github.com/users/EricForgy/followers","following_url":"https://api.github.com/users/EricForgy/following{/other_user}","gists_url":"https://api.github.com/users/EricForgy/gists{/gist_id}","starred_url":"https://api.github.com/users/EricForgy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EricForgy/subscriptions","organizations_url":"https://api.github.com/users/EricForgy/orgs","repos_url":"https://api.github.com/users/EricForgy/repos","events_url":"https://api.github.com/users/EricForgy/events{/privacy}","received_events_url":"https://api.github.com/users/EricForgy/received_events","type":"User","site_admin":false},"created_at":"2015-02-15T08:16:07Z","updated_at":"2015-02-15T08:16:07Z","body":"Hi Stefan,\r\n\r\nThanks for the explanation. I had a hunch this was by design, which is why I put \"question\" in the subject. However, regardless of how Julia handles matrices internally, I think it still makes sense to use row major for JSON. While researching a bit, I found the [following quote](http://arxiv.org/pdf/1403.2805.pdf):\r\n\r\n> Note that even though R stores matrices in column major order, jsonlite encodes matrices in row \r\n> major order. This is a more conventional and intuitive way to represent matrices and is consistent \r\n> with the row-based encoding of data frames discussed in the next section. When the JSON string is \r\n> properly indented (recall that white space and line breaks are optional in JSON), it looks very similar \r\n> to the way R prints matrices:\r\n>\r\n> [ [ 1, 4, 7, 10 ],\r\n> [ 2, 5, 8, 11 ],\r\n> [ 3, 6, 9, 12 ] ]\r\n\r\nI also think encoding in row major is more intuitive and visually looks better when printed, but I can get used to this I suppose. For example,\r\n\r\n     julia> b = [[1,4] [2,5] [3,6]]\r\n    2x3 Array{Int64,2}:\r\n     1  2  3\r\n     4  5  6\r\n    \r\n    julia> JSON.json(b)\r\n    \"[[1,4],[2,5],[3,6]]\"\r\n\r\nThis doesn't look too bad... I guess :)\r\n\r\nThen again, I can encode the transpose, but that doesn't feel right."}}