{"action":"closed","issue":{"url":"https://api.github.com/repos/lampepfl/dotty/issues/3878","repository_url":"https://api.github.com/repos/lampepfl/dotty","labels_url":"https://api.github.com/repos/lampepfl/dotty/issues/3878/labels{/name}","comments_url":"https://api.github.com/repos/lampepfl/dotty/issues/3878/comments","events_url":"https://api.github.com/repos/lampepfl/dotty/issues/3878/events","html_url":"https://github.com/lampepfl/dotty/issues/3878","id":290196375,"number":3878,"title":"Quoted var assignment","user":{"login":"nicolasstucki","id":3648029,"avatar_url":"https://avatars2.githubusercontent.com/u/3648029?v=4","gravatar_id":"","url":"https://api.github.com/users/nicolasstucki","html_url":"https://github.com/nicolasstucki","followers_url":"https://api.github.com/users/nicolasstucki/followers","following_url":"https://api.github.com/users/nicolasstucki/following{/other_user}","gists_url":"https://api.github.com/users/nicolasstucki/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolasstucki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolasstucki/subscriptions","organizations_url":"https://api.github.com/users/nicolasstucki/orgs","repos_url":"https://api.github.com/users/nicolasstucki/repos","events_url":"https://api.github.com/users/nicolasstucki/events{/privacy}","received_events_url":"https://api.github.com/users/nicolasstucki/received_events","type":"User","site_admin":false},"labels":[{"id":810919860,"url":"https://api.github.com/repos/lampepfl/dotty/labels/area:quoting","name":"area:quoting","color":"006b75","default":false},{"id":455448681,"url":"https://api.github.com/repos/lampepfl/dotty/labels/exp:expert","name":"exp:expert","color":"009800","default":false},{"id":21379539,"url":"https://api.github.com/repos/lampepfl/dotty/labels/itype:enhancement","name":"itype:enhancement","color":"cc317c","default":false},{"id":455449852,"url":"https://api.github.com/repos/lampepfl/dotty/labels/prio:medium","name":"prio:medium","color":"1d76db","default":false},{"id":154514922,"url":"https://api.github.com/repos/lampepfl/dotty/labels/stat:fix%20available","name":"stat:fix available","color":"f9d0c4","default":false}],"state":"closed","locked":false,"assignee":{"login":"nicolasstucki","id":3648029,"avatar_url":"https://avatars2.githubusercontent.com/u/3648029?v=4","gravatar_id":"","url":"https://api.github.com/users/nicolasstucki","html_url":"https://github.com/nicolasstucki","followers_url":"https://api.github.com/users/nicolasstucki/followers","following_url":"https://api.github.com/users/nicolasstucki/following{/other_user}","gists_url":"https://api.github.com/users/nicolasstucki/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolasstucki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolasstucki/subscriptions","organizations_url":"https://api.github.com/users/nicolasstucki/orgs","repos_url":"https://api.github.com/users/nicolasstucki/repos","events_url":"https://api.github.com/users/nicolasstucki/events{/privacy}","received_events_url":"https://api.github.com/users/nicolasstucki/received_events","type":"User","site_admin":false},"assignees":[{"login":"nicolasstucki","id":3648029,"avatar_url":"https://avatars2.githubusercontent.com/u/3648029?v=4","gravatar_id":"","url":"https://api.github.com/users/nicolasstucki","html_url":"https://github.com/nicolasstucki","followers_url":"https://api.github.com/users/nicolasstucki/followers","following_url":"https://api.github.com/users/nicolasstucki/following{/other_user}","gists_url":"https://api.github.com/users/nicolasstucki/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolasstucki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolasstucki/subscriptions","organizations_url":"https://api.github.com/users/nicolasstucki/orgs","repos_url":"https://api.github.com/users/nicolasstucki/repos","events_url":"https://api.github.com/users/nicolasstucki/events{/privacy}","received_events_url":"https://api.github.com/users/nicolasstucki/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2018-01-20T14:32:48Z","updated_at":"2018-03-16T10:08:02Z","closed_at":"2018-03-16T10:08:02Z","author_association":"CONTRIBUTOR","body":"To be able to use `var` we need to extend `Expr[T]` with a `VarExpr[T]` that allows the expression to be used in the left-hand side of an expression.\r\n```\r\ndef whileNotZero(body: VarExpr[Int] => Expr[Unit]) = '{\r\n  var x = 0\r\n  while (x == 0) ~body('(x))\r\n}\r\nwhileNotZero(x => '{ ~x = ~x - 1 })\r\n```\r\nCurrently in `'{ ~x = ~x - 1 }`, the left hand side cannot be spliced in. The `VarExpr[T]` would allow x to be spliced on the left hand side of the assignment.\r\n\r\n"}}
{"actor":{"display_login":"nicolasstucki"}}