"Before and after" in contracts?

bearophile bearophileHUGS at lycos.com
Wed Apr 13 09:42:56 PDT 2011


Magnus Lie Hetland:

> For me, I'd be happy if I could simply declare and initialize the 
> variables myself somehow before the body is executed, and then check 
> them in the out-block.

Indeed, as you may have seen in the linked threads, this was the main proposal in D. For me it's acceptable, if it works.


> Is there a feature request on this that I could add my vote to? If not, 
> perhaps it's worth creating one?

I don't know of any feature request on this (I have opened bug 5027 about ghost fields, but now I am less interested in them), so search for it in Bugzilla. If you don't find it, then it's worth adding, with plenty of explanations of its purposes and ideas of ways to implement it.


> If not, I guess I could just post a "bump" to the D group :-}

I think lately Walter has lost a bit of enthusiasm regarding Design By Contract. A little bump once in a while is acceptable, to show that some people care for this sub-feature. If you want to (gently) bump then you may do after writing the bug report and showing the bug report number.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list