Invariants are useless the way they are defined

H. S. Teoh hsteoh at quickfur.ath.cx
Mon Aug 26 10:26:38 PDT 2013


On Mon, Aug 26, 2013 at 07:20:21PM +0200, Timon Gehr wrote:
> On 08/26/2013 06:47 PM, H. S. Teoh wrote:
> >On Mon, Aug 26, 2013 at 06:16:25PM +0200, Timon Gehr wrote:
> >>On 08/26/2013 08:49 AM, deadalnix wrote:
> >>>
> >>>We simply need to add invariant check in the caller, not the callee,
> >>>and not introduce them if the caller is itself subject to invariant
> >>>insertion when called.
> >>
> >>The issue with this is that the invariant is not part of the public
> >>interface.
> >
> >The fact that contracts are not part of the public interface greatly
> >limits the usefulness of DbC in D. If they *were* part of the public
> >interface, there'd be more options to improve it.
> >
> >But this isn't the first time this is brought up, and it still seems no
> >solution is in sight. :-(
> >
> >
> >T
> >
> 
> (This was not a statement about Ds implementation. The invariant is
> by design a place to state facts about implementation details.)

Oh. I misunderstood what you said, then.


T

-- 
The two rules of success: 1. Don't tell everything you know. -- YHL


More information about the Digitalmars-d mailing list