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

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


On 25.06.2017 17:46, Petar Kirov [ZombineDev] wrote:
> On Sunday, 25 June 2017 at 12:10:02 UTC, Timon Gehr wrote:
>> 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
> 
> out result => result > 0 // not much worse

out(result; result > 0, "worse enough")

Also, what Guillaume said.


More information about the Digitalmars-d mailing list