{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/27608","repository_url":"https://api.github.com/repos/JuliaLang/julia","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/27608/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/27608/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/27608/events","html_url":"https://github.com/JuliaLang/julia/pull/27608","id":332953699,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1MzEzMDkw","number":27608,"title":"make &x sugar for RefValue(x)","user":{"login":"stevengj","id":2913679,"node_id":"MDQ6VXNlcjI5MTM2Nzk=","avatar_url":"https://avatars3.githubusercontent.com/u/2913679?v=4","gravatar_id":"","url":"https://api.github.com/users/stevengj","html_url":"https://github.com/stevengj","followers_url":"https://api.github.com/users/stevengj/followers","following_url":"https://api.github.com/users/stevengj/following{/other_user}","gists_url":"https://api.github.com/users/stevengj/gists{/gist_id}","starred_url":"https://api.github.com/users/stevengj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevengj/subscriptions","organizations_url":"https://api.github.com/users/stevengj/orgs","repos_url":"https://api.github.com/users/stevengj/repos","events_url":"https://api.github.com/users/stevengj/events{/privacy}","received_events_url":"https://api.github.com/users/stevengj/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":250223102,"node_id":"MDU6TGFiZWwyNTAyMjMxMDI=","url":"https://api.github.com/repos/JuliaLang/julia/labels/lowering","name":"lowering","color":"5319e7","default":false},{"id":294535982,"node_id":"MDU6TGFiZWwyOTQ1MzU5ODI=","url":"https://api.github.com/repos/JuliaLang/julia/labels/needs%20docs","name":"needs docs","color":"d4c5f9","default":false},{"id":421481488,"node_id":"MDU6TGFiZWw0MjE0ODE0ODg=","url":"https://api.github.com/repos/JuliaLang/julia/labels/needs%20news","name":"needs news","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-06-16T02:24:46Z","updated_at":"2018-06-18T16:11:46Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/27608","html_url":"https://github.com/JuliaLang/julia/pull/27608","diff_url":"https://github.com/JuliaLang/julia/pull/27608.diff","patch_url":"https://github.com/JuliaLang/julia/pull/27608.patch"},"body":"As suggested in #27563.     Note that `&x` was already parsed as a special expression node `Expr(:&, :x)`, which previously was used for a deprecated `ccall` syntax.   So all this PR does is to change the lowering to `RefValue(x)` (eliminating the deprecation).\r\n\r\nThis is especially useful for \"scalarizing\" arguments in dot calls (it also works with `@.`).  For example:\r\n```jl\r\njulia> x = [3,4,5]; \r\n\r\njulia> string.(x)\r\n3-element Array{String,1}:\r\n \"3\"\r\n \"4\"\r\n \"5\"\r\n\r\njulia> string.(&x)\r\n\"[3, 4, 5]\"\r\n\r\njulia> @. string(&x)\r\n\"[3, 4, 5]\"\r\n```\r\nI updated the Base, stdlib, and test code to use the `&` syntax and it looks pretty natural to me.\r\n\r\nTo do (assuming the consensus is in favor):\r\n- [x] Tests.  (Already exercised in Base.)\r\n- [ ] Documentation."},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/398108870","html_url":"https://github.com/JuliaLang/julia/pull/27608#issuecomment-398108870","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/27608","id":398108870,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODEwODg3MA==","user":{"login":"stevengj","id":2913679,"node_id":"MDQ6VXNlcjI5MTM2Nzk=","avatar_url":"https://avatars3.githubusercontent.com/u/2913679?v=4","gravatar_id":"","url":"https://api.github.com/users/stevengj","html_url":"https://github.com/stevengj","followers_url":"https://api.github.com/users/stevengj/followers","following_url":"https://api.github.com/users/stevengj/following{/other_user}","gists_url":"https://api.github.com/users/stevengj/gists{/gist_id}","starred_url":"https://api.github.com/users/stevengj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevengj/subscriptions","organizations_url":"https://api.github.com/users/stevengj/orgs","repos_url":"https://api.github.com/users/stevengj/repos","events_url":"https://api.github.com/users/stevengj/events{/privacy}","received_events_url":"https://api.github.com/users/stevengj/received_events","type":"User","site_admin":false},"created_at":"2018-06-18T16:11:46Z","updated_at":"2018-06-18T16:11:46Z","author_association":"MEMBER","body":"Right now, `&a[i]` and `&a.f` parse as `&(a[i])` and `@(a.f)`.  `a&[i]` parses as the bitwise `&` of `a` and `[i]`.  `a&.f` is a syntax error."}}
{"actor":{"display_login":"stevengj"}}