DIP 1003 Formal Review

Patrick Schluter via Digitalmars-d digitalmars-d at puremagic.com
Wed May 17 05:47:00 PDT 2017


On Tuesday, 16 May 2017 at 19:25:25 UTC, Steven Schveighoffer 
wrote:
>>
>> 1) Consistency with functions without contracts.
>
> This only applies to the "naked" version which has ugly }{ in 
> it. The other options people are asking about are replacing 
> body with a keyword, which I think you agree would be bad for 
> consistency?
>
I don't understand why this would be uglier than )( used in 
templates. Since imo it is one of the highlights of D to have 
"discovered" that one didn't need the super-ugly <> template pars 
of other languages, as the relative position in the code made it 
absolutely unambiguous which is which.
The same is true for function bodies. It is completely 
unambiguous where it starts and ends. As for }{, it would be rare 
anyway, as it would generally be written vertically
out {
   assert(whatever);
}
{
...
}

or even

out { assert(whatever);}
{
  ...
}




More information about the Digitalmars-d mailing list