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

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 28 07:13:44 PDT 2017


On 28.07.2017 13:04, Nick Treleaven wrote:
> On Friday, 21 July 2017 at 13:51:05 UTC, Mike Parker wrote:
>> DIP 1009 is titled "Improve Contract Usability".
>>
>> https://github.com/dlang/DIPs/blob/master/DIPs/DIP1009.md
> 
> I think the proposed in/out expression contracts should require pure 
> expressions. In the rare case that impurity is required, the old syntax 
> can be used. This makes the proposal more useful. Otherwise, the 
> expression would have to be awkwardly wrapped in `()pure => expr` code 
> to enforce this (without requiring purity of function body too). It's 
> too late to require purity for existing contract syntax, but we have an 
> opportunity here. ...

No, please. Even the fact that 'out' implicitly applies 'const' is 
annoying enough, and there is absolutely no good reason to make the two 
notations behave differently.


More information about the Digitalmars-d mailing list