A nice way to step into 2012

Timon Gehr timon.gehr at gmx.ch
Tue Dec 27 14:37:17 PST 2011


On 12/27/2011 11:27 PM, Timon Gehr wrote:
> On 12/27/2011 05:25 AM, Andrei Alexandrescu wrote:
>> https://github.com/D-Programming-Language/dmd/commit/675898721c04d0bf155a85abf986eae99c37c0dc
>>
>>
>>
>> Andrei
>
> Great! =)
>
> What about making => syntax available to named functions as well?
>
> class C{
> private int x;
> int getX() => x;
> }
>
>
> void main(){
> int[] arr;
> bool isOdd(int x) => x&1;
> writeln(arr.filter!isOdd());
> }
>

Also,

=> expr

should imo be a shorthand for

() => expr.

It saves some ((())(()))().






More information about the Digitalmars-d mailing list