"Before and after" in contracts?

spir denis.spir at gmail.com
Mon Apr 11 12:07:46 PDT 2011


On 04/11/2011 04:36 PM, Magnus Lie Hetland wrote:
> I guess I could just use a local variable (guarded by version()) and then have
> an assert() near the end of the function. Probably a better solution...

If you mean coding your checking "by habd" inside the func's "normal" body, 
this seems to me the right solution. In any case, much simpler and less 
contorsed than declaring an additional attribute just for that. I would add a 
comment note telling why it's coded that way (asp. if you use contracts elsewhere).
Contracts, like any software tool, do not correctly match all possibly needs.

Denis
-- 
_________________
vita es estrany
spir.wikidot.com



More information about the Digitalmars-d-learn mailing list