On 07/10/2013 02:32 PM, Brian Schott wrote:
> On Wednesday, 10 July 2013 at 21:16:30 UTC, Timon Gehr wrote:
>> The documentation is in error here.
>
> "(parameters) => expression" is mentioned in the source and I agree it's
> valid. I must have forgotton to copy-paste it.
>
> I don't agree that "function(parameters) => expression" is valid though.
> Can any of the DMD devs clear up if this is intended?

According to spec "function(parameters) => expression" is not valid.

  http://dlang.org/expression.html

Lambda:
    Identifier => AssignExpression
    ParameterAttributes => AssignExpression

Neither of those allow 'function' or 'delegate' keyword. However, I agree with Timon Gehr that the spec should be changed to match the current behavior.

Ali

Reply via email to