{"action":"created","issue":{"url":"https://api.github.com/repos/golo-lang/golo-lang/issues/190","labels_url":"https://api.github.com/repos/golo-lang/golo-lang/issues/190/labels{/name}","comments_url":"https://api.github.com/repos/golo-lang/golo-lang/issues/190/comments","events_url":"https://api.github.com/repos/golo-lang/golo-lang/issues/190/events","html_url":"https://github.com/golo-lang/golo-lang/pull/190","id":45502424,"number":190,"title":"Change the original function arity with decorators","user":{"login":"Artpej","id":693299,"avatar_url":"https://avatars.githubusercontent.com/u/693299?v=3","gravatar_id":"","url":"https://api.github.com/users/Artpej","html_url":"https://github.com/Artpej","followers_url":"https://api.github.com/users/Artpej/followers","following_url":"https://api.github.com/users/Artpej/following{/other_user}","gists_url":"https://api.github.com/users/Artpej/gists{/gist_id}","starred_url":"https://api.github.com/users/Artpej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Artpej/subscriptions","organizations_url":"https://api.github.com/users/Artpej/orgs","repos_url":"https://api.github.com/users/Artpej/repos","events_url":"https://api.github.com/users/Artpej/events{/privacy}","received_events_url":"https://api.github.com/users/Artpej/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/golo-lang/golo-lang/labels/evaluate","name":"evaluate","color":"fbca04"},{"url":"https://api.github.com/repos/golo-lang/golo-lang/labels/improvement","name":"improvement","color":"02d7e1"}],"state":"open","locked":false,"assignee":{"login":"Artpej","id":693299,"avatar_url":"https://avatars.githubusercontent.com/u/693299?v=3","gravatar_id":"","url":"https://api.github.com/users/Artpej","html_url":"https://github.com/Artpej","followers_url":"https://api.github.com/users/Artpej/followers","following_url":"https://api.github.com/users/Artpej/following{/other_user}","gists_url":"https://api.github.com/users/Artpej/gists{/gist_id}","starred_url":"https://api.github.com/users/Artpej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Artpej/subscriptions","organizations_url":"https://api.github.com/users/Artpej/orgs","repos_url":"https://api.github.com/users/Artpej/repos","events_url":"https://api.github.com/users/Artpej/events{/privacy}","received_events_url":"https://api.github.com/users/Artpej/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/golo-lang/golo-lang/milestones/13","html_url":"https://github.com/golo-lang/golo-lang/milestones/3.0.0","labels_url":"https://api.github.com/repos/golo-lang/golo-lang/milestones/13/labels","id":764265,"number":13,"title":"3.0.0","description":"Golo 3.0.0","creator":{"login":"jponge","id":25961,"avatar_url":"https://avatars.githubusercontent.com/u/25961?v=3","gravatar_id":"","url":"https://api.github.com/users/jponge","html_url":"https://github.com/jponge","followers_url":"https://api.github.com/users/jponge/followers","following_url":"https://api.github.com/users/jponge/following{/other_user}","gists_url":"https://api.github.com/users/jponge/gists{/gist_id}","starred_url":"https://api.github.com/users/jponge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jponge/subscriptions","organizations_url":"https://api.github.com/users/jponge/orgs","repos_url":"https://api.github.com/users/jponge/repos","events_url":"https://api.github.com/users/jponge/events{/privacy}","received_events_url":"https://api.github.com/users/jponge/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":16,"state":"open","created_at":"2014-08-25T07:43:41Z","updated_at":"2015-05-21T09:54:46Z","due_on":null,"closed_at":null},"comments":37,"created_at":"2014-10-10T17:08:19Z","updated_at":"2015-05-22T11:39:59Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/golo-lang/golo-lang/pulls/190","html_url":"https://github.com/golo-lang/golo-lang/pull/190","diff_url":"https://github.com/golo-lang/golo-lang/pull/190.diff","patch_url":"https://github.com/golo-lang/golo-lang/pull/190.patch"},"body":"It is not currently possible to change the\r\nthe arity of a decorated function.\r\n( see https://gist.github.com/yloiseau/d669c0e30023bf5b5bbc )\r\n\r\nOriginaly the function `foo`:\r\n\r\n```golo\r\nmodule curry\r\n\r\nfunction curry = |f| -> |a| -> |b| -> f(a, b)\r\n\r\n@curry\r\nfunction foo = |a,b| -> a + b\r\n\r\n```\r\n\r\nis converted to :\r\n\r\n```golo\r\nmodule curry\r\n\r\nfunction curry = |f| -> |a| -> |b| -> f(a, b)\r\n\r\nfunction foo = |a,b| -> ^curry( |a, b| -> a + b )(a, b)\r\n```\r\n\r\nThe trick tranforms the original function in a\r\nvariable arity function like this :\r\n\r\n```golo\r\nmodule curry\r\n\r\nfunction curry = |f| -> |a| -> |b| -> f(a, b)\r\n\r\nfunction foo = |args...| -> ^curry( |a, b| -> a + b ): invokeWithArguments(args)\r\n```"},"comment":{"url":"https://api.github.com/repos/golo-lang/golo-lang/issues/comments/104636992","html_url":"https://github.com/golo-lang/golo-lang/pull/190#issuecomment-104636992","issue_url":"https://api.github.com/repos/golo-lang/golo-lang/issues/190","id":104636992,"user":{"login":"jponge","id":25961,"avatar_url":"https://avatars.githubusercontent.com/u/25961?v=3","gravatar_id":"","url":"https://api.github.com/users/jponge","html_url":"https://github.com/jponge","followers_url":"https://api.github.com/users/jponge/followers","following_url":"https://api.github.com/users/jponge/following{/other_user}","gists_url":"https://api.github.com/users/jponge/gists{/gist_id}","starred_url":"https://api.github.com/users/jponge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jponge/subscriptions","organizations_url":"https://api.github.com/users/jponge/orgs","repos_url":"https://api.github.com/users/jponge/repos","events_url":"https://api.github.com/users/jponge/events{/privacy}","received_events_url":"https://api.github.com/users/jponge/received_events","type":"User","site_admin":false},"created_at":"2015-05-22T11:39:59Z","updated_at":"2015-05-22T11:39:59Z","body":"> It seems to me strange that my documentation addition is correct at the first pass \n\nOk, let me double-check then :-D\n\n> Just a last question about the @DecoratedBy annotation: for instance it take place directly in the gololang package, is it the right place? \n> Is this thing should be a part of the public API?\n> In this case, maybe we can create a gololang.annotations package for the futur works?\n\n:+1: for `gololang.annotations` (think about a package-info.java to say that what the package purpose is)."}}