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

MysticZach via Digitalmars-d digitalmars-d at puremagic.com
Thu Jun 22 05:54:00 PDT 2017


On Thursday, 22 June 2017 at 10:59:18 UTC, Moritz Maxeiner wrote:
> Again, that's not what H.S. Teoh's proposal would do. All it 
> does is install an *implementation agnostic*, *abtract* way to 
> specify contracts into the grammar. Whether that is lowered to 
> assert, or anything else is an implementation detail and it 
> certainly isn't fixed to asserts.

Okay. Then the proposal needs to be accompanied by an explicit 
description of how to hook into the new semantics. Which is what 
you provided, but I suppose it would need to be exactly 
specified. In particular, where exactly is the code for the 
(optional) user-defined hook to be found? In a separate file, 
maybe as indicated with a command line option, e.g. 
`-contractsConfig=myContracts.d`?

> DIP1003 did not introduce an entirely new system, it merely 
> slightly changed an existing sytem.
> DIP1009 *does* introduce several new syntax forms, i.e. adding 
> a whole new system, which means it *also* introduces the 
> responsibility of maintaining backwards compatibility when 
> someone tries to improve contracts again (and then we would 
> have three systems to specify contracts).

Okay, I'm a convert. Although still one big downside is that DbC 
in D is somewhat impaired, as H.S. Teoh pointed out [1].

[1] 
http://forum.dlang.org/post/mailman.3554.1498074198.31550.digitalmars-d@puremagic.com



More information about the Digitalmars-d mailing list