{"action":"created","comment":{"url":"https://api.github.com/repos/marick/Midje/pulls/comments/242697765","pull_request_review_id":186272171,"id":242697765,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MjY5Nzc2NQ==","diff_hunk":"@@ -71,19 +73,86 @@\n           num-tests               (or (:num-tests opts) 10)\n           quick-check-opts        (->> (select-keys opts [:seed :max-size])\n                                        (into [])\n-                                       flatten)]\n-      `(let [fact-fn#       (fn ~prop-names\n+                                       flatten)\n+          fact-fn-name            (gensym \"fact-fn\")]","path":"src/midje/parsing/0_to_fact_form/generative.clj","position":67,"original_position":18,"commit_id":"24222814f7916104a275df655beafc475d0f2a36","original_commit_id":"dba9347be7b14c0fe65c99f1aa1ae3b00586391a","user":{"login":"rafaeldff","id":99284,"node_id":"MDQ6VXNlcjk5Mjg0","avatar_url":"https://avatars2.githubusercontent.com/u/99284?v=4","gravatar_id":"","url":"https://api.github.com/users/rafaeldff","html_url":"https://github.com/rafaeldff","followers_url":"https://api.github.com/users/rafaeldff/followers","following_url":"https://api.github.com/users/rafaeldff/following{/other_user}","gists_url":"https://api.github.com/users/rafaeldff/gists{/gist_id}","starred_url":"https://api.github.com/users/rafaeldff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafaeldff/subscriptions","organizations_url":"https://api.github.com/users/rafaeldff/orgs","repos_url":"https://api.github.com/users/rafaeldff/repos","events_url":"https://api.github.com/users/rafaeldff/events{/privacy}","received_events_url":"https://api.github.com/users/rafaeldff/received_events","type":"User","site_admin":false},"body":"I was trying to make the for-all parser similar to the gen-let parser, in hope of finding common abstractions to share. Not a raging success so far.","created_at":"2018-12-18T20:41:47Z","updated_at":"2018-12-18T20:41:48Z","html_url":"https://github.com/marick/Midje/pull/449#discussion_r242697765","pull_request_url":"https://api.github.com/repos/marick/Midje/pulls/449","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/marick/Midje/pulls/comments/242697765"},"html":{"href":"https://github.com/marick/Midje/pull/449#discussion_r242697765"},"pull_request":{"href":"https://api.github.com/repos/marick/Midje/pulls/449"}},"in_reply_to_id":229998325},"pull_request":{"url":"https://api.github.com/repos/marick/Midje/pulls/449","id":225119679,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1MTE5Njc5","html_url":"https://github.com/marick/Midje/pull/449","diff_url":"https://github.com/marick/Midje/pull/449.diff","patch_url":"https://github.com/marick/Midje/pull/449.patch","issue_url":"https://api.github.com/repos/marick/Midje/issues/449","number":449,"state":"open","locked":false,"title":"New gen-let experimental syntax","user":{"login":"rafaeldff","id":99284,"node_id":"MDQ6VXNlcjk5Mjg0","avatar_url":"https://avatars2.githubusercontent.com/u/99284?v=4","gravatar_id":"","url":"https://api.github.com/users/rafaeldff","html_url":"https://github.com/rafaeldff","followers_url":"https://api.github.com/users/rafaeldff/followers","following_url":"https://api.github.com/users/rafaeldff/following{/other_user}","gists_url":"https://api.github.com/users/rafaeldff/gists{/gist_id}","starred_url":"https://api.github.com/users/rafaeldff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafaeldff/subscriptions","organizations_url":"https://api.github.com/users/rafaeldff/orgs","repos_url":"https://api.github.com/users/rafaeldff/repos","events_url":"https://api.github.com/users/rafaeldff/events{/privacy}","received_events_url":"https://api.github.com/users/rafaeldff/received_events","type":"User","site_admin":false},"body":"The experimental `(for-all)` macro allows for declaring generators that are easily integrated into midje tests. It does not, however, allow for composing generators. In this pull-request we introduce a new macro - `(gen-let)` - that desugars to a chain of `(gen/bind)`s, in a manner similar to `clojure.test.check.generators/let`. Eg:\r\n\r\n```clojure\r\n (fact \"composing generators\"\r\n  (gen-let [i  gen/s-pos-int\r\n            is (gen/vector gen/int i)\r\n            e  (gen/elements is)]\r\n    (count is) => i\r\n    (some #{e} is) => e)) \r\n```\r\n\r\nThe `gen-let` macro also supports binding intermediate computations with the `:let` keyword (syntax loosely inspired by clojure's `for` macro):\r\n\r\n```clojure\r\n (fact \"a :let block can be in the middle of gen-let bindings\"\r\n  (gen-let [i  (gen/choose 0 9)\r\n            :let [s  (str i)\r\n                  s2 (str s s)]\r\n            xs (gen/elements [s s2])]\r\n    (->> xs seq (map #(Character/getNumericValue %)) (some #{i})) => i)) \r\n```\r\n\r\nThe `for-all` macro is still useful because, even though we could express every test with `gen-let`, the `bind` based desugaring is less efficient and less amenable to test case shrinking. We have ideas about a future unification of the two macros, relying on more sophisticated static analysis, but it is not a trivial effort, and there are real use cases that could benefit from the proposed `gen-let` abstraction.","created_at":"2018-10-23T17:14:42Z","updated_at":"2018-12-18T20:41:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"825c32253248bd6cc808ef9aee2b8934fd5e494e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/marick/Midje/pulls/449/commits","review_comments_url":"https://api.github.com/repos/marick/Midje/pulls/449/comments","review_comment_url":"https://api.github.com/repos/marick/Midje/pulls/comments{/number}","comments_url":"https://api.github.com/repos/marick/Midje/issues/449/comments","statuses_url":"https://api.github.com/repos/marick/Midje/statuses/24222814f7916104a275df655beafc475d0f2a36","head":{"label":"marick:bind-sugar","ref":"bind-sugar","sha":"24222814f7916104a275df655beafc475d0f2a36","user":{"login":"marick","id":71909,"node_id":"MDQ6VXNlcjcxOTA5","avatar_url":"https://avatars3.githubusercontent.com/u/71909?v=4","gravatar_id":"","url":"https://api.github.com/users/marick","html_url":"https://github.com/marick","followers_url":"https://api.github.com/users/marick/followers","following_url":"https://api.github.com/users/marick/following{/other_user}","gists_url":"https://api.github.com/users/marick/gists{/gist_id}","starred_url":"https://api.github.com/users/marick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marick/subscriptions","organizations_url":"https://api.github.com/users/marick/orgs","repos_url":"https://api.github.com/users/marick/repos","events_url":"https://api.github.com/users/marick/events{/privacy}","received_events_url":"https://api.github.com/users/marick/received_events","type":"User","site_admin":false},"repo":{"id":682082,"node_id":"MDEwOlJlcG9zaXRvcnk2ODIwODI=","name":"Midje","full_name":"marick/Midje","private":false,"owner":{"login":"marick","id":71909,"node_id":"MDQ6VXNlcjcxOTA5","avatar_url":"https://avatars3.githubusercontent.com/u/71909?v=4","gravatar_id":"","url":"https://api.github.com/users/marick","html_url":"https://github.com/marick","followers_url":"https://api.github.com/users/marick/followers","following_url":"https://api.github.com/users/marick/following{/other_user}","gists_url":"https://api.github.com/users/marick/gists{/gist_id}","starred_url":"https://api.github.com/users/marick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marick/subscriptions","organizations_url":"https://api.github.com/users/marick/orgs","repos_url":"https://api.github.com/users/marick/repos","events_url":"https://api.github.com/users/marick/events{/privacy}","received_events_url":"https://api.github.com/users/marick/received_events","type":"User","site_admin":false},"html_url":"https://github.com/marick/Midje","description":"Midje provides a migration path from clojure.test to a more flexible, readable, abstract, and gracious style of testing","fork":false,"url":"https://api.github.com/repos/marick/Midje","forks_url":"https://api.github.com/repos/marick/Midje/forks","keys_url":"https://api.github.com/repos/marick/Midje/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marick/Midje/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marick/Midje/teams","hooks_url":"https://api.github.com/repos/marick/Midje/hooks","issue_events_url":"https://api.github.com/repos/marick/Midje/issues/events{/number}","events_url":"https://api.github.com/repos/marick/Midje/events","assignees_url":"https://api.github.com/repos/marick/Midje/assignees{/user}","branches_url":"https://api.github.com/repos/marick/Midje/branches{/branch}","tags_url":"https://api.github.com/repos/marick/Midje/tags","blobs_url":"https://api.github.com/repos/marick/Midje/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marick/Midje/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marick/Midje/git/refs{/sha}","trees_url":"https://api.github.com/repos/marick/Midje/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marick/Midje/statuses/{sha}","languages_url":"https://api.github.com/repos/marick/Midje/languages","stargazers_url":"https://api.github.com/repos/marick/Midje/stargazers","contributors_url":"https://api.github.com/repos/marick/Midje/contributors","subscribers_url":"https://api.github.com/repos/marick/Midje/subscribers","subscription_url":"https://api.github.com/repos/marick/Midje/subscription","commits_url":"https://api.github.com/repos/marick/Midje/commits{/sha}","git_commits_url":"https://api.github.com/repos/marick/Midje/git/commits{/sha}","comments_url":"https://api.github.com/repos/marick/Midje/comments{/number}","issue_comment_url":"https://api.github.com/repos/marick/Midje/issues/comments{/number}","contents_url":"https://api.github.com/repos/marick/Midje/contents/{+path}","compare_url":"https://api.github.com/repos/marick/Midje/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marick/Midje/merges","archive_url":"https://api.github.com/repos/marick/Midje/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marick/Midje/downloads","issues_url":"https://api.github.com/repos/marick/Midje/issues{/number}","pulls_url":"https://api.github.com/repos/marick/Midje/pulls{/number}","milestones_url":"https://api.github.com/repos/marick/Midje/milestones{/number}","notifications_url":"https://api.github.com/repos/marick/Midje/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marick/Midje/labels{/name}","releases_url":"https://api.github.com/repos/marick/Midje/releases{/id}","deployments_url":"https://api.github.com/repos/marick/Midje/deployments","created_at":"2010-05-23T19:00:57Z","updated_at":"2018-12-14T08:58:53Z","pushed_at":"2018-12-16T09:40:31Z","git_url":"git://github.com/marick/Midje.git","ssh_url":"git@github.com:marick/Midje.git","clone_url":"https://github.com/marick/Midje.git","svn_url":"https://github.com/marick/Midje","homepage":"","size":72966,"stargazers_count":1433,"watchers_count":1433,"language":"Clojure","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":124,"mirror_url":null,"archived":false,"open_issues_count":41,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":124,"open_issues":41,"watchers":1433,"default_branch":"master"}},"base":{"label":"marick:master","ref":"master","sha":"81f9d5a1d67b82623789c4639455de9003e6db1a","user":{"login":"marick","id":71909,"node_id":"MDQ6VXNlcjcxOTA5","avatar_url":"https://avatars3.githubusercontent.com/u/71909?v=4","gravatar_id":"","url":"https://api.github.com/users/marick","html_url":"https://github.com/marick","followers_url":"https://api.github.com/users/marick/followers","following_url":"https://api.github.com/users/marick/following{/other_user}","gists_url":"https://api.github.com/users/marick/gists{/gist_id}","starred_url":"https://api.github.com/users/marick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marick/subscriptions","organizations_url":"https://api.github.com/users/marick/orgs","repos_url":"https://api.github.com/users/marick/repos","events_url":"https://api.github.com/users/marick/events{/privacy}","received_events_url":"https://api.github.com/users/marick/received_events","type":"User","site_admin":false},"repo":{"id":682082,"node_id":"MDEwOlJlcG9zaXRvcnk2ODIwODI=","name":"Midje","full_name":"marick/Midje","private":false,"owner":{"login":"marick","id":71909,"node_id":"MDQ6VXNlcjcxOTA5","avatar_url":"https://avatars3.githubusercontent.com/u/71909?v=4","gravatar_id":"","url":"https://api.github.com/users/marick","html_url":"https://github.com/marick","followers_url":"https://api.github.com/users/marick/followers","following_url":"https://api.github.com/users/marick/following{/other_user}","gists_url":"https://api.github.com/users/marick/gists{/gist_id}","starred_url":"https://api.github.com/users/marick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marick/subscriptions","organizations_url":"https://api.github.com/users/marick/orgs","repos_url":"https://api.github.com/users/marick/repos","events_url":"https://api.github.com/users/marick/events{/privacy}","received_events_url":"https://api.github.com/users/marick/received_events","type":"User","site_admin":false},"html_url":"https://github.com/marick/Midje","description":"Midje provides a migration path from clojure.test to a more flexible, readable, abstract, and gracious style of testing","fork":false,"url":"https://api.github.com/repos/marick/Midje","forks_url":"https://api.github.com/repos/marick/Midje/forks","keys_url":"https://api.github.com/repos/marick/Midje/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marick/Midje/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marick/Midje/teams","hooks_url":"https://api.github.com/repos/marick/Midje/hooks","issue_events_url":"https://api.github.com/repos/marick/Midje/issues/events{/number}","events_url":"https://api.github.com/repos/marick/Midje/events","assignees_url":"https://api.github.com/repos/marick/Midje/assignees{/user}","branches_url":"https://api.github.com/repos/marick/Midje/branches{/branch}","tags_url":"https://api.github.com/repos/marick/Midje/tags","blobs_url":"https://api.github.com/repos/marick/Midje/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marick/Midje/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marick/Midje/git/refs{/sha}","trees_url":"https://api.github.com/repos/marick/Midje/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marick/Midje/statuses/{sha}","languages_url":"https://api.github.com/repos/marick/Midje/languages","stargazers_url":"https://api.github.com/repos/marick/Midje/stargazers","contributors_url":"https://api.github.com/repos/marick/Midje/contributors","subscribers_url":"https://api.github.com/repos/marick/Midje/subscribers","subscription_url":"https://api.github.com/repos/marick/Midje/subscription","commits_url":"https://api.github.com/repos/marick/Midje/commits{/sha}","git_commits_url":"https://api.github.com/repos/marick/Midje/git/commits{/sha}","comments_url":"https://api.github.com/repos/marick/Midje/comments{/number}","issue_comment_url":"https://api.github.com/repos/marick/Midje/issues/comments{/number}","contents_url":"https://api.github.com/repos/marick/Midje/contents/{+path}","compare_url":"https://api.github.com/repos/marick/Midje/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marick/Midje/merges","archive_url":"https://api.github.com/repos/marick/Midje/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marick/Midje/downloads","issues_url":"https://api.github.com/repos/marick/Midje/issues{/number}","pulls_url":"https://api.github.com/repos/marick/Midje/pulls{/number}","milestones_url":"https://api.github.com/repos/marick/Midje/milestones{/number}","notifications_url":"https://api.github.com/repos/marick/Midje/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marick/Midje/labels{/name}","releases_url":"https://api.github.com/repos/marick/Midje/releases{/id}","deployments_url":"https://api.github.com/repos/marick/Midje/deployments","created_at":"2010-05-23T19:00:57Z","updated_at":"2018-12-14T08:58:53Z","pushed_at":"2018-12-16T09:40:31Z","git_url":"git://github.com/marick/Midje.git","ssh_url":"git@github.com:marick/Midje.git","clone_url":"https://github.com/marick/Midje.git","svn_url":"https://github.com/marick/Midje","homepage":"","size":72966,"stargazers_count":1433,"watchers_count":1433,"language":"Clojure","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":124,"mirror_url":null,"archived":false,"open_issues_count":41,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":124,"open_issues":41,"watchers":1433,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/marick/Midje/pulls/449"},"html":{"href":"https://github.com/marick/Midje/pull/449"},"issue":{"href":"https://api.github.com/repos/marick/Midje/issues/449"},"comments":{"href":"https://api.github.com/repos/marick/Midje/issues/449/comments"},"review_comments":{"href":"https://api.github.com/repos/marick/Midje/pulls/449/comments"},"review_comment":{"href":"https://api.github.com/repos/marick/Midje/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/marick/Midje/pulls/449/commits"},"statuses":{"href":"https://api.github.com/repos/marick/Midje/statuses/24222814f7916104a275df655beafc475d0f2a36"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"rafaeldff"}}