{"action":"created","issue":{"url":"https://api.github.com/repos/nim-lang/Nim/issues/1037","labels_url":"https://api.github.com/repos/nim-lang/Nim/issues/1037/labels{/name}","comments_url":"https://api.github.com/repos/nim-lang/Nim/issues/1037/comments","events_url":"https://api.github.com/repos/nim-lang/Nim/issues/1037/events","html_url":"https://github.com/nim-lang/Nim/issues/1037","id":30207108,"number":1037,"title":"Feature request: anonymous var's","user":{"login":"exetoc","id":1609261,"avatar_url":"https://avatars.githubusercontent.com/u/1609261?v=3","gravatar_id":"","url":"https://api.github.com/users/exetoc","html_url":"https://github.com/exetoc","followers_url":"https://api.github.com/users/exetoc/followers","following_url":"https://api.github.com/users/exetoc/following{/other_user}","gists_url":"https://api.github.com/users/exetoc/gists{/gist_id}","starred_url":"https://api.github.com/users/exetoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exetoc/subscriptions","organizations_url":"https://api.github.com/users/exetoc/orgs","repos_url":"https://api.github.com/users/exetoc/repos","events_url":"https://api.github.com/users/exetoc/events{/privacy}","received_events_url":"https://api.github.com/users/exetoc/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nim-lang/Nim/labels/Feature","name":"Feature","color":"0080f0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-03-26T12:33:02Z","updated_at":"2015-06-27T02:59:58Z","closed_at":null,"body":"Consider these procs:\r\n```nimrod\r\nproc p1: int = 1\r\nproc p2(i: var int): int = i + 1\r\n```\r\n\r\nNow compare this:\r\n```nimrod\r\nvar x = p1()\r\nvar y = p2(x)\r\n```\r\nTo something like this:\r\n```nimrod\r\nvar y = p2(p1())\r\n```\r\nOr this, which would force the caller to document the fact that any modifications will essentially be discarded:\r\n```nimrod\r\nvar y = p2(var p1())\r\n```\r\n\r\nThis would of course be more useful in more complicated examples, possible involving more than just a single var. Sometimes wrapping a proc removes the need for this, but not always."},"comment":{"url":"https://api.github.com/repos/nim-lang/Nim/issues/comments/115944264","html_url":"https://github.com/nim-lang/Nim/issues/1037#issuecomment-115944264","issue_url":"https://api.github.com/repos/nim-lang/Nim/issues/1037","id":115944264,"user":{"login":"BigBoneDaddy","id":13056703,"avatar_url":"https://avatars.githubusercontent.com/u/13056703?v=3","gravatar_id":"","url":"https://api.github.com/users/BigBoneDaddy","html_url":"https://github.com/BigBoneDaddy","followers_url":"https://api.github.com/users/BigBoneDaddy/followers","following_url":"https://api.github.com/users/BigBoneDaddy/following{/other_user}","gists_url":"https://api.github.com/users/BigBoneDaddy/gists{/gist_id}","starred_url":"https://api.github.com/users/BigBoneDaddy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BigBoneDaddy/subscriptions","organizations_url":"https://api.github.com/users/BigBoneDaddy/orgs","repos_url":"https://api.github.com/users/BigBoneDaddy/repos","events_url":"https://api.github.com/users/BigBoneDaddy/events{/privacy}","received_events_url":"https://api.github.com/users/BigBoneDaddy/received_events","type":"User","site_admin":false},"created_at":"2015-06-27T02:59:58Z","updated_at":"2015-06-27T02:59:58Z","body":"This does not make sense to me either"}}