{"action":"created","issue":{"url":"https://api.github.com/repos/fponticelli/thx.core/issues/53","labels_url":"https://api.github.com/repos/fponticelli/thx.core/issues/53/labels{/name}","comments_url":"https://api.github.com/repos/fponticelli/thx.core/issues/53/comments","events_url":"https://api.github.com/repos/fponticelli/thx.core/issues/53/events","html_url":"https://github.com/fponticelli/thx.core/pull/53","id":84114106,"number":53,"title":"Lambda lambda lambda","user":{"login":"francescoagati","id":175524,"avatar_url":"https://avatars.githubusercontent.com/u/175524?v=3","gravatar_id":"","url":"https://api.github.com/users/francescoagati","html_url":"https://github.com/francescoagati","followers_url":"https://api.github.com/users/francescoagati/followers","following_url":"https://api.github.com/users/francescoagati/following{/other_user}","gists_url":"https://api.github.com/users/francescoagati/gists{/gist_id}","starred_url":"https://api.github.com/users/francescoagati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/francescoagati/subscriptions","organizations_url":"https://api.github.com/users/francescoagati/orgs","repos_url":"https://api.github.com/users/francescoagati/repos","events_url":"https://api.github.com/users/francescoagati/events{/privacy}","received_events_url":"https://api.github.com/users/francescoagati/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-06-02T17:16:29Z","updated_at":"2015-06-02T20:07:45Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/fponticelli/thx.core/pulls/53","html_url":"https://github.com/fponticelli/thx.core/pull/53","diff_url":"https://github.com/fponticelli/thx.core/pull/53.diff","patch_url":"https://github.com/fponticelli/thx.core/pull/53.patch"},"body":"Hi,\r\nthis a pull request for merge some of the function of lib funcgen (functions short lambda and forms inspired to lisp).\r\ni have create the namespace thx.macros.lambda for add Functions and Forms.\r\nand add to macro a function replaceSymbol for symbols manipulation.\r\n\r\nAn example of shortlambdas and forms\r\n\r\n```\r\nimport thx.macro.lambda.Functions.*;\r\nimport thx.macro.lambda.Forms.*;\r\n\r\nclass TestLambda {\r\n  public function new() { }\r\n\r\n  public function testFunctions() {\r\n    Assert.same([2,3], [1,2].map(fn(_+1)));\r\n    Assert.equals(0, fn0((0))());\r\n    Assert.equals(2, fn1((_1))(2));\r\n    Assert.equals(3, fn2(_1+_2)(1,2));\r\n    Assert.equals(6, fn3(_1+_2+_3)(1,2,3));\r\n    Assert.equals(10, fn4(_1+_2+_3+_4)(1,2,3,4));\r\n    Assert.equals(15, fn5(_1+_2+_3+_4+_5)(1,2,3,4,5));\r\n    Assert.equals(6, fn5(_1+_2+_3)(1,2,3,4,5));\r\n  }\r\n\r\n  public function testForms() {\r\n    with(Assert,{\r\n      _.equals(1,1);\r\n\r\n      var check1 = 0;\r\n      when(1==1,{\r\n        _.equals(1,1);\r\n        check1 = 1;\r\n      });\r\n      _.equals(check1,1);\r\n\r\n      var check2 = 0;\r\n      unless(1==1,{\r\n        _.equals(1,1);\r\n        check2 = 1;\r\n      });\r\n      _.equals(check2,0);\r\n\r\n      var check3 = 0;\r\n      unless(1!=1,{\r\n        _.equals(1,1);\r\n        check3 = 1;\r\n      });\r\n      _.equals(check3,1);\r\n\r\n      var check5 = 0;\r\n      when(and(1==1,2==2),{\r\n        _.equals(1,1);\r\n        check5 = 1;\r\n      });\r\n      _.equals(check5,1);\r\n\r\n      var check6 = 0;\r\n      when(or(1==2,2==2),{\r\n        _.equals(1,1);\r\n        check6 = 1;\r\n      });\r\n      _.equals(check6,1);\r\n\r\n      _.equals(false,not(true));\r\n      _.equals(true,not(false));\r\n      \r\n    });\r\n\r\n```\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/fponticelli/thx.core/issues/comments/108081443","html_url":"https://github.com/fponticelli/thx.core/pull/53#issuecomment-108081443","issue_url":"https://api.github.com/repos/fponticelli/thx.core/issues/53","id":108081443,"user":{"login":"francescoagati","id":175524,"avatar_url":"https://avatars.githubusercontent.com/u/175524?v=3","gravatar_id":"","url":"https://api.github.com/users/francescoagati","html_url":"https://github.com/francescoagati","followers_url":"https://api.github.com/users/francescoagati/followers","following_url":"https://api.github.com/users/francescoagati/following{/other_user}","gists_url":"https://api.github.com/users/francescoagati/gists{/gist_id}","starred_url":"https://api.github.com/users/francescoagati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/francescoagati/subscriptions","organizations_url":"https://api.github.com/users/francescoagati/orgs","repos_url":"https://api.github.com/users/francescoagati/repos","events_url":"https://api.github.com/users/francescoagati/events{/privacy}","received_events_url":"https://api.github.com/users/francescoagati/received_events","type":"User","site_admin":false},"created_at":"2015-06-02T20:07:45Z","updated_at":"2015-06-02T20:07:45Z","body":"yes in effect i have write this code much faster for see how can be used. After the works on fn arguments i will do a clean up.\r\n\r\nI don't know if symbol _ can go in conflict with _ used in bind and switch.\r\nIn other language are used other symbols. Groovy and Livescript use \"it\" but also it can go in conflict with for example jasmine test in javascript.\r\n\r\nfor params counter livescript use &0,&1 and clojure %0,%1\r\n"}}