{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/27533","repository_url":"https://api.github.com/repos/JuliaLang/julia","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/27533/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/27533/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/27533/events","html_url":"https://github.com/JuliaLang/julia/issues/27533","id":331261880,"node_id":"MDU6SXNzdWUzMzEyNjE4ODA=","number":27533,"title":"Feature request: add operator to allow break lines in matrix definition","user":{"login":"ronisbr","id":1068295,"node_id":"MDQ6VXNlcjEwNjgyOTU=","avatar_url":"https://avatars1.githubusercontent.com/u/1068295?v=4","gravatar_id":"","url":"https://api.github.com/users/ronisbr","html_url":"https://github.com/ronisbr","followers_url":"https://api.github.com/users/ronisbr/followers","following_url":"https://api.github.com/users/ronisbr/following{/other_user}","gists_url":"https://api.github.com/users/ronisbr/gists{/gist_id}","starred_url":"https://api.github.com/users/ronisbr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronisbr/subscriptions","organizations_url":"https://api.github.com/users/ronisbr/orgs","repos_url":"https://api.github.com/users/ronisbr/repos","events_url":"https://api.github.com/users/ronisbr/events{/privacy}","received_events_url":"https://api.github.com/users/ronisbr/received_events","type":"User","site_admin":false},"labels":[{"id":371587497,"node_id":"MDU6TGFiZWwzNzE1ODc0OTc=","url":"https://api.github.com/repos/JuliaLang/julia/labels/design","name":"design","color":"e99695","default":false},{"id":163368715,"node_id":"MDU6TGFiZWwxNjMzNjg3MTU=","url":"https://api.github.com/repos/JuliaLang/julia/labels/parser","name":"parser","color":"bfdadc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":20,"created_at":"2018-06-11T16:32:07Z","updated_at":"2018-06-12T14:45:15Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Hi guys,\r\n\r\nI have started a discussion in Discourse [1] about how can we define a matrix with break lines without creating a new row. For example:\r\n\r\n```julia\r\nA = [1 2 3 4 5\r\n     6 7 8 9 10]\r\n```\r\n\r\nis translated as a 2x5 matrix, because the break line character is interpreted as the end of the first row (which is good). However, I was implemented MSIS model [2] which requires the definition of matrices with 150 columns. In this case, if I choose to hard-coded those matrices in the source code to maintain compatibility, I will have to type 150 floats in one line, which is not good.\r\n\r\nMatlab has the `...` operator for this:\r\n\r\n```Matlab\r\nA = [1 2 3 4 5 ...\r\n     6 7 8 9 10]\r\n```\r\n\r\nwhich translates into a 1x10 matrix.\r\n\r\nFinally, I am wondering if we can have something like this in Julia. Currently, the only workaround as proposed in [1] is to trick the parser as follows:\r\n\r\n```julia\r\nA = [1 2 3 4 [5\r\n     ] 6 7 8 9 10]\r\n```\r\n\r\nwhich works but it is not \"optimal\".\r\n\r\n----\r\n[1] https://discourse.julialang.org/t/declare-a-matrix-with-break-lines/11568/18\r\n[2] https://ccmc.gsfc.nasa.gov/pub/modelweb/atmospheric/msis/nrlmsise00/nrlmsise00_sub.for"},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/396615904","html_url":"https://github.com/JuliaLang/julia/issues/27533#issuecomment-396615904","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/27533","id":396615904,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NjYxNTkwNA==","user":{"login":"oxinabox","id":5127634,"node_id":"MDQ6VXNlcjUxMjc2MzQ=","avatar_url":"https://avatars0.githubusercontent.com/u/5127634?v=4","gravatar_id":"","url":"https://api.github.com/users/oxinabox","html_url":"https://github.com/oxinabox","followers_url":"https://api.github.com/users/oxinabox/followers","following_url":"https://api.github.com/users/oxinabox/following{/other_user}","gists_url":"https://api.github.com/users/oxinabox/gists{/gist_id}","starred_url":"https://api.github.com/users/oxinabox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oxinabox/subscriptions","organizations_url":"https://api.github.com/users/oxinabox/orgs","repos_url":"https://api.github.com/users/oxinabox/repos","events_url":"https://api.github.com/users/oxinabox/events{/privacy}","received_events_url":"https://api.github.com/users/oxinabox/received_events","type":"User","site_admin":false},"created_at":"2018-06-12T14:45:14Z","updated_at":"2018-06-12T14:45:14Z","author_association":"CONTRIBUTOR","body":"I would expect doing latex style \"Commenting out the new like\" to break things.\r\n\r\nUnless it was restricted to only a `#` without any non-whitespace after.\r\nFor example:\r\n```\r\ncolors = [ 0.5 0.2 0.1 0.9 # Red\r\n                0.4 0.4 0.1 0.6 # Green\r\n                0.1 0.2 0.1 0.1] # Blue\r\n```\r\n\r\nIn LaTeX that not have any new lines in it.\r\nAnd having an empty comment act differently to a non-empty one sounds weird.\r\n\r\nI was not actually suggesting it for julia.\r\nI think `\\\\` would be much less confusing.\r\nThough making giant multiline literals seems  pretty niche.\r\nEven more so than having literals for `Array{T, 3}`.\r\n\r\nOne should be able to construct them just as efficiently using  the `vect` and  the `cat` commands  that literal lowers to anyway."}}
{"actor":{"display_login":"oxinabox"}}