{"action":"created","issue":{"url":"https://api.github.com/repos/dlang/dmd/issues/7484","repository_url":"https://api.github.com/repos/dlang/dmd","labels_url":"https://api.github.com/repos/dlang/dmd/issues/7484/labels{/name}","comments_url":"https://api.github.com/repos/dlang/dmd/issues/7484/comments","events_url":"https://api.github.com/repos/dlang/dmd/issues/7484/events","html_url":"https://github.com/dlang/dmd/pull/7484","id":283876926,"number":7484,"title":"[WIP] Add initial implementation of lambda comparison","user":{"login":"RazvanN7","id":22907766,"avatar_url":"https://avatars2.githubusercontent.com/u/22907766?v=4","gravatar_id":"","url":"https://api.github.com/users/RazvanN7","html_url":"https://github.com/RazvanN7","followers_url":"https://api.github.com/users/RazvanN7/followers","following_url":"https://api.github.com/users/RazvanN7/following{/other_user}","gists_url":"https://api.github.com/users/RazvanN7/gists{/gist_id}","starred_url":"https://api.github.com/users/RazvanN7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RazvanN7/subscriptions","organizations_url":"https://api.github.com/users/RazvanN7/orgs","repos_url":"https://api.github.com/users/RazvanN7/repos","events_url":"https://api.github.com/users/RazvanN7/events{/privacy}","received_events_url":"https://api.github.com/users/RazvanN7/received_events","type":"User","site_admin":false},"labels":[{"id":639748221,"url":"https://api.github.com/repos/dlang/dmd/labels/WIP","name":"WIP","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-12-21T13:07:52Z","updated_at":"2017-12-21T13:24:14Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/dlang/dmd/pulls/7484","html_url":"https://github.com/dlang/dmd/pull/7484","diff_url":"https://github.com/dlang/dmd/pull/7484.diff","patch_url":"https://github.com/dlang/dmd/pull/7484.patch"},"body":"This PR implements the first draft of the lambda comparison project. For the moment, it is possible to compare lambda functions :\r\n\r\n-> which use in their body only parameters, IntegerExps and enums (no runtime variables)\r\n-> that have user defined types as parameter types\r\n\r\nA lambda function which has runtime variables or function calls in its body will be considered uncomparable for the moment. I plan on working on that case.\r\n\r\nThe current PR is just a proof of concept and I am sure that there are a lot of corner cases that I've missed and if you identify such cases please report them. I plan an adding some tests in the next commit and also try to see if function calls can be supported by putting the mangled name of the function in the lambda serialization."},"comment":{"url":"https://api.github.com/repos/dlang/dmd/issues/comments/353349848","html_url":"https://github.com/dlang/dmd/pull/7484#issuecomment-353349848","issue_url":"https://api.github.com/repos/dlang/dmd/issues/7484","id":353349848,"user":{"login":"wilzbach","id":4370550,"avatar_url":"https://avatars3.githubusercontent.com/u/4370550?v=4","gravatar_id":"","url":"https://api.github.com/users/wilzbach","html_url":"https://github.com/wilzbach","followers_url":"https://api.github.com/users/wilzbach/followers","following_url":"https://api.github.com/users/wilzbach/following{/other_user}","gists_url":"https://api.github.com/users/wilzbach/gists{/gist_id}","starred_url":"https://api.github.com/users/wilzbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilzbach/subscriptions","organizations_url":"https://api.github.com/users/wilzbach/orgs","repos_url":"https://api.github.com/users/wilzbach/repos","events_url":"https://api.github.com/users/wilzbach/events{/privacy}","received_events_url":"https://api.github.com/users/wilzbach/received_events","type":"User","site_admin":false},"created_at":"2017-12-21T13:24:14Z","updated_at":"2017-12-21T13:24:14Z","author_association":"MEMBER","body":"> What's the use case motivating this?\r\n\r\nA good example of my head is this recent PR which makes {min,max}Element faster https://github.com/dlang/phobos/pull/4265\r\nFor an identity map function, the algorithm is 6x faster with LDC.\r\nSo how do we check for identity?\r\nCurrently the only ways are (a) string lambdas (`enum isIdentity = map == \"a\";`) or (b) using many overloads (that's what we did with {min,max}Element eventually).\r\nI really look forward to use the new trait for such optimizations :)"}}
{"actor":{"display_login":"wilzbach"}}