DIP 1003: remove `body` as a keyword

Meta via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Tue Nov 22 11:05:02 PST 2016


On Tuesday, 22 November 2016 at 15:11:04 UTC, Sönke Ludwig wrote:
> Am 21.11.2016 um 22:19 schrieb Timon Gehr:
>> 3 is ambiguous.
>
> Can you give an example?

I'm curious as well. I considered that option 3 might be 
ambiguous but I managed to convince myself that it wouldn't be. 
I'm guessing you're referring to the fact that:

{
     //function body
}

Is a delegate literal, which could conceivably conflict with 
Option 3's syntax?

void fun(ref int n)
in { assert(n > 0); }
out { assert(n > 0); }
{ //Is this a syntax error or an immediately executed delegate 
literal?
     n += 1;
}()


More information about the Digitalmars-d-announce mailing list