[Issue 7364] Better Eponymous Template syntax

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jul 19 05:42:11 PDT 2013


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



--- Comment #9 from Nick Treleaven <ntrel-public at yahoo.co.uk> 2013-07-19 05:42:08 PDT ---
It might be easier to implement (particularly for templates resolving to
functions) if we didn't reuse a keyword. Perhaps use __self:

template longNameWithSpecializations
{
    void __self(){...}
    void __self(int i){...}
}

The compiler can replace __self with the innermost template name. A nice side
effect might be anonymous lambda recursion:

a => a > 2 ? a * __self(a - 1) : a

I think lambdas are implemented as templates, so the above feature might work
naturally.

Eventually it would be nice if error messages used myTemplate.__self instead of
myTemplate.myTemplate.

-- 
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