{"action":"created","issue":{"url":"https://api.github.com/repos/DalekBaldwin/check-it/issues/17","labels_url":"https://api.github.com/repos/DalekBaldwin/check-it/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/DalekBaldwin/check-it/issues/17/comments","events_url":"https://api.github.com/repos/DalekBaldwin/check-it/issues/17/events","html_url":"https://github.com/DalekBaldwin/check-it/pull/17","id":99930924,"number":17,"title":"Added the macro with-generators.","user":{"login":"malisper","id":6210567,"avatar_url":"https://avatars.githubusercontent.com/u/6210567?v=3","gravatar_id":"","url":"https://api.github.com/users/malisper","html_url":"https://github.com/malisper","followers_url":"https://api.github.com/users/malisper/followers","following_url":"https://api.github.com/users/malisper/following{/other_user}","gists_url":"https://api.github.com/users/malisper/gists{/gist_id}","starred_url":"https://api.github.com/users/malisper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malisper/subscriptions","organizations_url":"https://api.github.com/users/malisper/orgs","repos_url":"https://api.github.com/users/malisper/repos","events_url":"https://api.github.com/users/malisper/events{/privacy}","received_events_url":"https://api.github.com/users/malisper/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-08-09T21:34:04Z","updated_at":"2015-09-02T18:03:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/DalekBaldwin/check-it/pulls/17","html_url":"https://github.com/DalekBaldwin/check-it/pull/17","diff_url":"https://github.com/DalekBaldwin/check-it/pull/17.diff","patch_url":"https://github.com/DalekBaldwin/check-it/pull/17.patch"},"body":"It makes it easier to bind generators to variables and run tests with\r\nthem. For example:\r\n\r\n    (with-generators ((x (integer)) \r\n                      (y (integer)))\r\n      (check-that (= (+ x y) (+ x y)))\r\n      ;; Case designed to fail.\r\n      (check-that (= (+ x y) (+ x y 1))))\r\n\r\nI plan on writing a more powerful version that would allow something such as the following:\r\n\r\n    (with-generators ((x (integer))\r\n                      (y (integer)))\r\n      (let ((result (+ x y)))\r\n        (check-that (= result result))\r\n        (check-that (= result (+ result 1)))))\r\n\r\nI can think of no easy way to implement it except by using a code walker."},"comment":{"url":"https://api.github.com/repos/DalekBaldwin/check-it/issues/comments/137192843","html_url":"https://github.com/DalekBaldwin/check-it/pull/17#issuecomment-137192843","issue_url":"https://api.github.com/repos/DalekBaldwin/check-it/issues/17","id":137192843,"user":{"login":"malisper","id":6210567,"avatar_url":"https://avatars.githubusercontent.com/u/6210567?v=3","gravatar_id":"","url":"https://api.github.com/users/malisper","html_url":"https://github.com/malisper","followers_url":"https://api.github.com/users/malisper/followers","following_url":"https://api.github.com/users/malisper/following{/other_user}","gists_url":"https://api.github.com/users/malisper/gists{/gist_id}","starred_url":"https://api.github.com/users/malisper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malisper/subscriptions","organizations_url":"https://api.github.com/users/malisper/orgs","repos_url":"https://api.github.com/users/malisper/repos","events_url":"https://api.github.com/users/malisper/events{/privacy}","received_events_url":"https://api.github.com/users/malisper/received_events","type":"User","site_admin":false},"created_at":"2015-09-02T18:03:22Z","updated_at":"2015-09-02T18:03:22Z","body":"I was using check-it to run some tests on an implementation of red-black trees and realized that there is a problem with the way you are using closures to keep track of the variables - it is no longer possible to use mutation on those variables! I would generate a list of values and then insert them all into the tree while at the same time testing properties of the tree. In the case of failure, the `check-it` expression needs to know how the tree was built. I don't think it is possible to keep track of the mutations made with closures."}}