{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/26088","repository_url":"https://api.github.com/repos/JuliaLang/julia","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/26088/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/26088/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/26088/events","html_url":"https://github.com/JuliaLang/julia/pull/26088","id":297944114,"number":26088,"title":"make `.=` return its right hand side. fixes #25954","user":{"login":"JeffBezanson","id":744556,"avatar_url":"https://avatars0.githubusercontent.com/u/744556?v=4","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},"labels":[{"id":756208727,"url":"https://api.github.com/repos/JuliaLang/julia/labels/broadcast","name":"broadcast","color":"3289b5","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2018-02-16T22:50:03Z","updated_at":"2018-02-22T22:19:35Z","closed_at":null,"author_association":"OWNER","pull_request":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/26088","html_url":"https://github.com/JuliaLang/julia/pull/26088","diff_url":"https://github.com/JuliaLang/julia/pull/26088.diff","patch_url":"https://github.com/JuliaLang/julia/pull/26088.patch"},"body":"This is a really simple, sub-optimal solution to try to get the right behavior in place quickly. The hack is to lower `.=` both ways (the usual broadcast fusion way, and the version that saves the RHS in a temporary variable), and select one at the point where we know whether the expression's value is used.\r\n\r\nIf we want, the same mechanism could instead be used to give an error for using the value of `.=`, if we'd rather not decide now."},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/367842067","html_url":"https://github.com/JuliaLang/julia/pull/26088#issuecomment-367842067","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/26088","id":367842067,"user":{"login":"stevengj","id":2913679,"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-02-22T22:19:35Z","updated_at":"2018-02-22T22:19:35Z","author_association":"OWNER","body":"Because the whole point of `.=`, almost the *only* reason to use it, is to avoid allocating the right-hand-side?  Because it is defined to be sugar for `broadcast!`?\r\n\r\nThe question is, are there any practical circumstances where the users of `.=` will be happy if you allocate the RHS in order to return it?  Or will basically all users of `.=` be annoyed by this behavior?\r\n\r\nWould you be happy if you wrote `return x .= sin.(y)` or `sort!(x .= sin.(y))` and it returned a new array rather than `x`?"}}
{"actor":{"display_login":"stevengj"}}