[Issue 10819] Invalid comparison for equality of lambda functions
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Aug 14 10:33:36 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10819
--- Comment #3 from Peter Alexander <peter.alexander.au at gmail.com> 2013-08-14 10:33:34 PDT ---
(In reply to comment #2)
> you take the expression threes of the lambdas and test if they are exactly the
> same (minus whitespace and stripping away documentation comments).
But how does that work across modules?
Lambdas are mangled as modulenameN__lambdaX, where X is just an increasing
integer for each lambda in the module.
If lambdas are to be equal then they must also mangle equal. Currently lambdas
in different modules will mangle differently, regardless of the AST, and
separate compilation ensures this.
You could possibly work around this by mangling lambdas as just
__lambdaXXXXXXXX where the Xs are a hash of the lambda AST (hope for no
collisions). This does mean however that lambda types are moduleless... I'm not
sure how that would affect other parts of the language and runtime.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list