Setting a list of values

Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon May 2 16:41:39 PDT 2016


On 5/2/16 6:00 PM, sigod wrote:
> On Monday, 2 May 2016 at 10:15:04 UTC, Marc Schütz wrote:
>> On Monday, 2 May 2016 at 08:46:31 UTC, Ali Çehreli wrote:
>>> [...]
>>
>> Warning (better: disallowing altogether) about `=>` directly followed
>> by `{` should be enough to cover all cases. To express that you really
>> want a lambda returning a lambda, it can be rewritten either as:
>>
>>     (x) => () { assert(x); }
>>
>> or as:
>>
>>     (x) => ({ assert(x); })
>>
>> This check can be done purely by looking at the tokens. Should we
>> someday introduce tuples with `{}`, the check needs to be done after
>> the node starting with `{` has been parsed to distinguish between
>> delegate and tuple literals.
>
> It's good idea. I myself stumbled into this before.

Agree.

-Steve


More information about the Digitalmars-d-learn mailing list