DIP 1009--Improve Contract Usability--Preliminary Review Round 2 Begins

Moritz Maxeiner via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 28 09:58:41 PDT 2017


On Friday, 28 July 2017 at 16:44:24 UTC, MysticZach wrote:
> On Friday, 28 July 2017 at 11:04:23 UTC, Nick Treleaven wrote:
>> One option to solve the out contract ambiguity and aid parsing 
>> by tools is to require 'do' after out contract expressions. It 
>> allows the syntax `out(expression) do {...}`, even when 
>> expression is a single identifier that should be interpreted 
>> as a boolean expression.
>
> One of the main goals of this DIP is to eliminate the need for 
> `body/do` in the common case. It would significantly reduce 
> this DIP's value if it couldn't do that, IMO.

This*1000.
Having a keyword delimit the end of an optional is both redundant 
and inconsistent with virtually every other rule in the D grammar 
(except old contract syntax). It's one of the (two) major reasons 
why I don't use the original contract syntax.


More information about the Digitalmars-d mailing list