Is the compiler supposed to accept this?

Timon Gehr timon.gehr at gmx.ch
Tue Jul 9 16:35:13 PDT 2013


On 07/10/2013 01:24 AM, Brian Schott wrote:
> While finishing up work on my parser and grammar specification I found
> this in container.d:
>
> return equal!(function(Elem a, Elem b) => !_less(a,b) && !_less(b,a))
>                       (thisRange, thatRange);
>
> It seems to be some strange hybrid of the function literal syntax and
> the lambda syntax.

=>... is supposed to be just a shorthand for { return ...; }

> It's not documented anywhere (surprise!) and I'm not
> sure if I should support it or file an accepts-invalid bug against DMD.


I'd say support it and file a bug against the documentation.



More information about the Digitalmars-d mailing list