Syntactical sugar for string templates and lambdas?

via Digitalmars-d digitalmars-d at puremagic.com
Tue Aug 26 03:10:06 PDT 2014


I have spent some time thinking about how the D syntax can be 
polished by adding sugar. I wonder if this would be possible to 
implement in the parser:


IN:
(int`x + int`y) * `y

OUT:
(int __1,int __2) => (__1 + __2) * __2


IN:
callTemplate!(`mycmp`(`a,1+2))

OUT:
calltemplate!("mycmp(a," ~ __to_string( 1+2 ) ~ ")")



Ola.


More information about the Digitalmars-d mailing list