{"action":"created","issue":{"url":"https://api.github.com/repos/hylang/hy/issues/920","labels_url":"https://api.github.com/repos/hylang/hy/issues/920/labels{/name}","comments_url":"https://api.github.com/repos/hylang/hy/issues/920/comments","events_url":"https://api.github.com/repos/hylang/hy/issues/920/events","html_url":"https://github.com/hylang/hy/pull/920","id":103069322,"number":920,"title":"Remove redundant assignments with nested ifs (closes #842)","user":{"login":"kirbyfan64","id":1690697,"avatar_url":"https://avatars.githubusercontent.com/u/1690697?v=3","gravatar_id":"","url":"https://api.github.com/users/kirbyfan64","html_url":"https://github.com/kirbyfan64","followers_url":"https://api.github.com/users/kirbyfan64/followers","following_url":"https://api.github.com/users/kirbyfan64/following{/other_user}","gists_url":"https://api.github.com/users/kirbyfan64/gists{/gist_id}","starred_url":"https://api.github.com/users/kirbyfan64/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kirbyfan64/subscriptions","organizations_url":"https://api.github.com/users/kirbyfan64/orgs","repos_url":"https://api.github.com/users/kirbyfan64/repos","events_url":"https://api.github.com/users/kirbyfan64/events{/privacy}","received_events_url":"https://api.github.com/users/kirbyfan64/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-25T16:45:50Z","updated_at":"2015-09-19T19:26:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hylang/hy/pulls/920","html_url":"https://github.com/hylang/hy/pull/920","diff_url":"https://github.com/hylang/hy/pull/920.diff","patch_url":"https://github.com/hylang/hy/pull/920.patch"},"body":"This just reuses the same temporary across nested if branches."},"comment":{"url":"https://api.github.com/repos/hylang/hy/issues/comments/141700503","html_url":"https://github.com/hylang/hy/pull/920#issuecomment-141700503","issue_url":"https://api.github.com/repos/hylang/hy/issues/920","id":141700503,"user":{"login":"gilch","id":3346292,"avatar_url":"https://avatars.githubusercontent.com/u/3346292?v=3","gravatar_id":"","url":"https://api.github.com/users/gilch","html_url":"https://github.com/gilch","followers_url":"https://api.github.com/users/gilch/followers","following_url":"https://api.github.com/users/gilch/following{/other_user}","gists_url":"https://api.github.com/users/gilch/gists{/gist_id}","starred_url":"https://api.github.com/users/gilch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gilch/subscriptions","organizations_url":"https://api.github.com/users/gilch/orgs","repos_url":"https://api.github.com/users/gilch/repos","events_url":"https://api.github.com/users/gilch/events{/privacy}","received_events_url":"https://api.github.com/users/gilch/received_events","type":"User","site_admin":false},"created_at":"2015-09-19T19:26:37Z","updated_at":"2015-09-19T19:26:37Z","body":">  I would've thought @gilch would like this.\r\n\r\n:+1: \r\n\r\nI might have said so sooner if you had an example of what it changed, but it took a while to figure out what you were talking about. As it was it had to wait until I had the free time to test it.\r\n\r\nSomething like this...\r\n\r\nBefore:\r\n```Hy\r\n=> (if 1 1 (if 2 (setv x 2) (if 3 3)))\r\nif 1:\r\n    _hy_anon_var_2 = 1\r\nelse:\r\n    if 2:\r\n        x = 2\r\n        _hy_anon_var_1 = x\r\n    else:\r\n        _hy_anon_var_1 = (3 if 3 else None)\r\n    _hy_anon_var_2 = _hy_anon_var_1\r\n```\r\nAfter:\r\n```Hy\r\n=> (if 1 1 (if 2 (setv x 2) (if 3 3)))\r\nif 1:\r\n    _hy_anon_var_1 = 1\r\nelif 2:\r\n    x = 2\r\n    _hy_anon_var_1 = x\r\nelse:\r\n    _hy_anon_var_1 = (3 if 3 else None)\r\n```\r\nI should probably just set up another virtual environment so I can compare a new branch side by side with the current version."}}