Another idiom I wish were gone from phobos/druntime

via Digitalmars-d digitalmars-d at puremagic.com
Thu Feb 5 00:25:05 PST 2015


On Thursday, 5 February 2015 at 08:05:30 UTC, Jonathan M Davis 
wrote:
> So, while in principle, it would be great if assertions related 
> to contracts
> were enabled or disabled by the caller, not only does it not 
> work that way
> now, I have no idea how it even could work that way.

You could have an IDE and build system that makes signatures, 
unit tests and pre/post conditions essentially read only. Then 
any modifications to the program specification is either 
impossible or is flagged as something that is up for negotiation. 
The build system/compiler can trivially emit contracts to a 
database. If the contracts change then all code that depend on 
them will have to be revalidated/recompiled.

It is important for D that the D developers keep in mind that the 
language and the compiler should be designed as separate 
entities. DMD-internals have too much influence over the language 
design already.


More information about the Digitalmars-d mailing list