www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7308] New: Lambda template literals

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7308

           Summary: Lambda template literals
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



Currently (DMD 2.058head) this kind of code is not allowed, but I think it's
handy to have (I suggest to require the () around the lambda template):


void main() {
    alias (x =>  x ^^ 2) sqrTemplate;
}



Timon Gehr reminds me that the semantics of that code is already available,
just with a longer syntax:


template ID(alias a){alias a ID;}
void main(){
     alias ID!(x => x ^^ 2) sqrTemplate;
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 17 2012
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7308




A note from Philippe Sigaud:
http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.learn&artnum=31736

 If you do an enhancement request, could you also add one for:

 alias __traits(whatever, whatever) some Result;

 Right now, the alias grammar doesn't allow this and I find this
 limitation jarring.
-- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 19 2012