DIP 1009--Improve Contract Usability--Preliminary Review Round 1

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Sun Jun 25 05:10:02 PDT 2017


On 25.06.2017 13:37, Andrei Alexandrescu wrote:
> On 6/23/17 6:52 PM, jmh530 wrote:
>> On Friday, 23 June 2017 at 17:31:15 UTC, MysticZach wrote:
>>>
>>> OutExpression:
>>>   out ( ; AssertParameters )
>>>   out ( Identifier ; AssertParameters )
>>
>> Why not?
>>
>> OutExpression:
>>    out ( AssertParameters )
>>    out ( Identifier ; AssertParameters )
> 
> The path of least resistance is to use existing language constructs, i.e.
> 
> out result => assert(result > 0)
> 
> 
> Andrei
This would face quite some resistance, on the following grounds:

out(result){ assert(result > 0); } // exists

out result => assert(result > 0) // more of the same

out(result; result > 0) // better


More information about the Digitalmars-d mailing list