D enters Tiobe top 20

Timon Gehr timon.gehr at gmx.ch
Tue Nov 12 12:36:24 UTC 2019


On 12.11.19 12:35, Walter Bright wrote:
> On 11/12/2019 2:51 AM, Timon Gehr wrote:
>>> If in{} and out{} contracts ever disappeared from the language, I 
>>> think an external solver would need something like assume()/require() 
>>> to distinguish preconditions from normal assertions.
>>> ...
>>
>> Yes, this was exactly my point.
> 
> The precondition would just be the sequence of assert()s before any 
> other code, and the postcondition is the sequence that appears after any 
> other code.

I understand, and this strategy has the weaknesses I pointed out.

> It's not a challenge to pull that out of the AST.

Of course it is not challenging to implement. The point is that it is 
not a great idea, not that it is hard to do.


More information about the Digitalmars-d mailing list