Functional Programming with D

bearophile bearophileHUGS at lycos.com
Sat Apr 13 13:15:36 PDT 2013


Timon Gehr:

>> auto square6 = x => x*x;
>>
>
> no. (valid grammar, but you need some type annotation.)

In theory a syntax like:

alias square6 = x => x * x;

Can be a shorthand for a template function like:

auto square6(T0)(T0 x) { return x * x; }

Bye,
bearophile


More information about the Digitalmars-d-announce mailing list