DIP 1003: remove `body` as a keyword

Timon Gehr via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Wed Nov 23 12:24:13 PST 2016


On 23.11.2016 11:15, Sönke Ludwig wrote:
>>
>> Function declarations don't necessarily have a body, but they might have
>> contracts. (This is currently not allowed for technical reasons, but it
>> should/will be.) But this is a rather minor point (usually you don't
>> want to have contracts without implementation in a context where
>> something starting with '{' is allowed).
>
> Okay, but that doesn't sound like there is a technical ambiguity here,
> then? Since there must be a full (block) statement after the in/out, it
> should always resolve naturally.

Technically, there is an ambiguity (technically, ambiguity means that 
there are multiple grammar derivations resulting in the same sentence).
Pragmatically, the greedy parse-the-body-if-possible-approach will work.


More information about the Digitalmars-d-announce mailing list