http://d.puremagic.com/issues/show_bug.cgi?id=10819


[email protected] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]


--- Comment #2 from [email protected] 2013-08-14 10:07:22 PDT ---
(In reply to comment #1)
> How would you define equality for lambda functions?

You don't compute in general the equivalence of two programs. Currently if you
use the "string lambdas" then for the "a > b" and "a >b" the D compiler can't
tell they are the same. So as usual you look for a rough solution. This means
you take the expression threes of the lambdas and test if they are exactly the
same (minus whitespace and stripping away documentation comments).


Related: elsewhere people have proposed a __trait(ast, some_code_here) that
returns the syntax tree of some given code. The tree is composed of structs and
other types defined in Phobos or elsewhere, and you can process such tree
through regular user D code. I think this allows poor's man macros almost
entirely implemented in library D code. And they become a bit nicer once
"__traits(ast, ...)" is written like meta.ast(...).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to