On Friday, 1 August 2014 at 23:13:28 UTC, H. S. Teoh via
Digitalmars-d wrote:
IMO the correct solution is for the compiler to insert
preconditions at the calling site, rather than the callee.
If we had that, I'd actually start using in blocks. As it is, I
think that they're useless except when inheritance is involved,
and they're more verbose than just putting the assertions at the
top of the function, so I don't bother with the in block.
But certainly, in principle, I agree that whether contracts are
used would depend on the flags used when compiler the caller, not
the callee, but the separate compilation model does throw some
kinks in that. But even if it just worked in cases where the
source code was available, it would be an improvement.
- Jonathan M Davis
- Re: assume, assert, enforce, @safe Jonathan M Davis via Digitalmars-d
- Re: assume, assert, enforce, @safe Kagamin via Digitalmars-d
- Re: assume, assert, enforce, @safe Sean Kelly via Digitalmars-d
- Re: assume, assert, enforce, @... Dicebot via Digitalmars-d
- Re: assume, assert, enforce, @... Daniel Murphy via Digitalmars-d
- Re: assume, assert, enforc... Sean Kelly via Digitalmars-d
- Re: assume, assert, enforc... Walter Bright via Digitalmars-d
- Re: assume, assert, enforc... H. S. Teoh via Digitalmars-d
- Re: assume, assert, enforc... Jonathan M Davis via Digitalmars-d
- Re: assume, assert, enforc... Timon Gehr via Digitalmars-d
- Re: assume, assert, enforc... Daniel Murphy via Digitalmars-d
- Re: assume, assert, enforc... bearophile via Digitalmars-d
- Re: assume, assert, enforc... Daniel Murphy via Digitalmars-d
- Re: assume, assert, enforc... bearophile via Digitalmars-d
- Re: assume, assert, enforc... bearophile via Digitalmars-d
- Re: assume, assert, enforc... Daniel Murphy via Digitalmars-d
- Re: assume, assert, enforc... bearophile via Digitalmars-d
- Re: assume, assert, enforc... H. S. Teoh via Digitalmars-d
- Re: assume, assert, enforc... Timon Gehr via Digitalmars-d