{"action":"created","issue":{"url":"https://api.github.com/repos/getquill/quill/issues/271","repository_url":"https://api.github.com/repos/getquill/quill","labels_url":"https://api.github.com/repos/getquill/quill/issues/271/labels{/name}","comments_url":"https://api.github.com/repos/getquill/quill/issues/271/comments","events_url":"https://api.github.com/repos/getquill/quill/issues/271/events","html_url":"https://github.com/getquill/quill/pull/271","id":140544610,"number":271,"title":"add support for inline vals in quotation blocks","user":{"login":"godenji","id":238557,"avatar_url":"https://avatars.githubusercontent.com/u/238557?v=3","gravatar_id":"","url":"https://api.github.com/users/godenji","html_url":"https://github.com/godenji","followers_url":"https://api.github.com/users/godenji/followers","following_url":"https://api.github.com/users/godenji/following{/other_user}","gists_url":"https://api.github.com/users/godenji/gists{/gist_id}","starred_url":"https://api.github.com/users/godenji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/godenji/subscriptions","organizations_url":"https://api.github.com/users/godenji/orgs","repos_url":"https://api.github.com/users/godenji/repos","events_url":"https://api.github.com/users/godenji/events{/privacy}","received_events_url":"https://api.github.com/users/godenji/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/getquill/quill/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-13T23:50:36Z","updated_at":"2016-03-14T16:00:31Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/getquill/quill/pulls/271","html_url":"https://github.com/getquill/quill/pull/271","diff_url":"https://github.com/getquill/quill/pull/271.diff","patch_url":"https://github.com/getquill/quill/pull/271.patch"},"body":"Fixes #77 \r\n\r\n### Problem\r\n\r\nCurrently impossible to build up computations based on a series of steps within a `quote` block.\r\n\r\n### Solution\r\n\r\nAdded two new AST types `Block` and `Val` which correspond to parse tree `q\"{..$exprs}\"` and `q\"val $name: $typ = $body\"` respectively. Given a `Block` the last statement (i.e. return value of the block) is inlined with the query expression(s) it represents. @see `BetaReduction.scala` `Block` and `Ident` case match\r\n\r\n### Notes\r\n\r\nImplementing `getOrElse` on `Option[T]` types would be a nice complement to this PR. I looked into it but can see no obvious way to encode this in the AST and somehow thread through default value to, for example, [JdbcDecoders](https://github.com/getquill/quill/blob/master/quill-jdbc/src/main/scala/io/getquill/sources/jdbc/JdbcDecoders.scala#L22)\r\n\r\n### Checklist\r\n\r\n- [x] Unit test all changes\r\n- [ ] Update `README.md` if applicable\r\n- [ ] Add `[WIP]` to the pull request title if it's work in progress\r\n- [x] [Squash commits](https://ariejan.net/2011/07/05/git-squash-your-latests-commits-into-one) that aren't meaningful changes\r\n- [x] Run `sbt scalariformFormat` to make sure that the source files are formatted\r\n\r\n@getquill/maintainers\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/getquill/quill/issues/comments/196383928","html_url":"https://github.com/getquill/quill/pull/271#issuecomment-196383928","issue_url":"https://api.github.com/repos/getquill/quill/issues/271","id":196383928,"user":{"login":"gustavoamigo","id":4032109,"avatar_url":"https://avatars.githubusercontent.com/u/4032109?v=3","gravatar_id":"","url":"https://api.github.com/users/gustavoamigo","html_url":"https://github.com/gustavoamigo","followers_url":"https://api.github.com/users/gustavoamigo/followers","following_url":"https://api.github.com/users/gustavoamigo/following{/other_user}","gists_url":"https://api.github.com/users/gustavoamigo/gists{/gist_id}","starred_url":"https://api.github.com/users/gustavoamigo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gustavoamigo/subscriptions","organizations_url":"https://api.github.com/users/gustavoamigo/orgs","repos_url":"https://api.github.com/users/gustavoamigo/repos","events_url":"https://api.github.com/users/gustavoamigo/events{/privacy}","received_events_url":"https://api.github.com/users/gustavoamigo/received_events","type":"User","site_admin":false},"created_at":"2016-03-14T16:00:31Z","updated_at":"2016-03-14T16:00:31Z","body":"What a great PR!!! :clap: \r\n\r\nOne question, is this a WIP? "}}