D's design by contract is missing "old"?
Deewiant
deewiant.doesnotlike.spam at gmail.com
Mon Jun 18 11:42:16 PDT 2007
Russ Williams wrote:
> Manfred Nowak Wrote:
>> In fact pre- and postconditions seem to be nothing else than blocks that
>> are injected into the function body by `scope(entry)' and `scope (exit)'
>> respectively.
>
> They are a little more than that since there are implications for inheritance
> (a precondition can be weakened in a derived class, and a postcondition can
> be strengthened in a derived class, which means OR-ing the preconditions of
> base.f() and derived.f() and AND-ing the postconditions).
>
> That inheritance aspect of DBC is defined in the language and done by the
> compiler so the programmer doesn't have to write boilerplate code to screw
> with it.
Yeah, except: http://d.puremagic.com/issues/show_bug.cgi?id=302
--
Remove ".doesnotlike.spam" from the mail address.
More information about the Digitalmars-d-learn
mailing list