{"action":"created","issue":{"url":"https://api.github.com/repos/CoCoViLa/CoCoViLa/issues/12","labels_url":"https://api.github.com/repos/CoCoViLa/CoCoViLa/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/CoCoViLa/CoCoViLa/issues/12/comments","events_url":"https://api.github.com/repos/CoCoViLa/CoCoViLa/issues/12/events","html_url":"https://github.com/CoCoViLa/CoCoViLa/issues/12","id":54165033,"number":12,"title":"Lambdas as realisations of axioms","user":{"login":"MastaP","id":185344,"avatar_url":"https://avatars.githubusercontent.com/u/185344?v=3","gravatar_id":"","url":"https://api.github.com/users/MastaP","html_url":"https://github.com/MastaP","followers_url":"https://api.github.com/users/MastaP/followers","following_url":"https://api.github.com/users/MastaP/following{/other_user}","gists_url":"https://api.github.com/users/MastaP/gists{/gist_id}","starred_url":"https://api.github.com/users/MastaP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MastaP/subscriptions","organizations_url":"https://api.github.com/users/MastaP/orgs","repos_url":"https://api.github.com/users/MastaP/repos","events_url":"https://api.github.com/users/MastaP/events{/privacy}","received_events_url":"https://api.github.com/users/MastaP/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/CoCoViLa/CoCoViLa/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-13T08:58:21Z","updated_at":"2015-01-13T12:42:15Z","closed_at":null,"body":"@vkotkas @jexek Lets gather some ideas regarding the subject.\r\n\r\nFirst question: Allow specifying full-blown lambdas together with arguments, e.g.\r\n`a, b -> c {(x, y) -> x + y};`\r\nor, as the list of arguments is already given in the axiom, just allow specifying lambda body as the realisation:\r\n`a, b -> c {a + b};`\r\nHmm, but in that case we need to parse lambda body and rename the variables...\r\n\r\nSecond question: In order to invoke a lambda, it needs to be mapped to a suitable functional interface.\r\n(I.e. `c = (x,y) -> x + y)(a, b);` is not going to work).\r\n\r\nFor each lambda, it's possible to generate an interface on the fly:\r\n```\r\npublic void compute( Object... cocovilaArgs ) {\r\n...\r\n   c = ((F)(x,y) -> x + y).apply(a, b);\r\n}\r\ninterface F { int apply(int n, int m); }\r\n```"},"comment":{"url":"https://api.github.com/repos/CoCoViLa/CoCoViLa/issues/comments/69738655","html_url":"https://github.com/CoCoViLa/CoCoViLa/issues/12#issuecomment-69738655","issue_url":"https://api.github.com/repos/CoCoViLa/CoCoViLa/issues/12","id":69738655,"user":{"login":"vkotkas","id":7438021,"avatar_url":"https://avatars.githubusercontent.com/u/7438021?v=3","gravatar_id":"","url":"https://api.github.com/users/vkotkas","html_url":"https://github.com/vkotkas","followers_url":"https://api.github.com/users/vkotkas/followers","following_url":"https://api.github.com/users/vkotkas/following{/other_user}","gists_url":"https://api.github.com/users/vkotkas/gists{/gist_id}","starred_url":"https://api.github.com/users/vkotkas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkotkas/subscriptions","organizations_url":"https://api.github.com/users/vkotkas/orgs","repos_url":"https://api.github.com/users/vkotkas/repos","events_url":"https://api.github.com/users/vkotkas/events{/privacy}","received_events_url":"https://api.github.com/users/vkotkas/received_events","type":"User","site_admin":false},"created_at":"2015-01-13T12:42:15Z","updated_at":"2015-01-13T12:42:15Z","body":"First question: I still, regardless of the possible extra work needed, prefer the second variant for readability. I would like to avoid unneccessary duplications. Similarly I don't like duplications of types in port or field definition when it's already defined in the specification.\r\n\r\nSecond question: I cannot see a problem in your proposal ... maybe you can give a hint why are you puzzled. You can still generalize the interfaces to be generated and reuse them."}}