Contract checking (Re: enforce()?)

2010-06-30 Thread Norbert Nemec
On 28/06/10 12:59, bearophile wrote: Norbert Nemec: [...] to place code for input contract checking in the *calling* code. [...] Output contract checks, on the other hand should be compiled inside the returning routine. Is this a positive thing to do? Can this be done? (D must support separate

Re: Contract checking (Re: enforce()?)

2010-06-30 Thread Sean Kelly
Norbert Nemec Wrote: > On 28/06/10 12:59, bearophile wrote: > > Norbert Nemec: > >> [...] to place code for input contract checking in the *calling* code. > >> [...] > >> Output contract checks, on the other hand should be compiled inside the > >> returning routine. > > > > Is this a positive thi

Re: Contract checking (Re: enforce()?)

2010-06-30 Thread Norbert Nemec
On 30/06/10 17:45, Sean Kelly wrote: Norbert Nemec Wrote: On 28/06/10 12:59, bearophile wrote: Norbert Nemec: [...] to place code for input contract checking in the *calling* code. [...] Output contract checks, on the other hand should be compiled inside the returning routine. Is this a pos

Re: Contract checking (Re: enforce()?)

2010-09-10 Thread Jay Byrd
On Wed, 30 Jun 2010 20:03:07 +0100, Norbert Nemec wrote: > On 30/06/10 17:45, Sean Kelly wrote: >> Norbert Nemec Wrote: >> >>> On 28/06/10 12:59, bearophile wrote: Norbert Nemec: > [...] to place code for input contract checking in the *calling* > code. [...] Output contract checks, o

Re: Contract checking (Re: enforce()?)

2010-09-11 Thread bearophile
Jay Byrd: > This is all very confused, and is reflected in D implementing contracts all > wrong. If you know well the ideas of DbC, and you think there are some problems in the DbC of D2, then I suggest you to not just write what's wrong, why it is wrong and what bad things such wrong design ma

Re: Contract checking (Re: enforce()?)

2010-09-11 Thread bearophile
> then I suggest you to not just write what's... Ignore that 'not', please.

Re: Contract checking (Re: enforce()?)

2010-09-11 Thread retard
Sat, 11 Sep 2010 07:16:56 -0400, bearophile wrote: > Jay Byrd: >> This is all very confused, and is reflected in D implementing contracts >> all wrong. > > If you know well the ideas of DbC, and you think there are some problems > in the DbC of D2, then I suggest you to not just write what's wron

Re: Contract checking (Re: enforce()?)

2010-09-11 Thread Norbert Nemec
On 11/09/10 08:18, Jay Byrd wrote: Contracts do not belong to function pointers or any other dynamic state -- they apply to the invoker, and thus the static type. Isn't that obvious? In fact, it is yet one step more complex than that: as the name itself suggests, contracts are "between" the ca

Re: Contract checking (Re: enforce()?)

2010-09-12 Thread bearophile
Norbert Nemec: Thank you for your clear explanations of the situation. > With FP/DG, this breaks > down and I believe the best one can do is to implement contracts as > run-time checks in the callee, just as it is done in D. There is also a mixed strategy: to use run-time checks in the callee

Re: Contract checking (Re: enforce()?)

2010-09-12 Thread Norbert Nemec
On 12/09/10 14:48, bearophile wrote: Norbert Nemec: Thank you for your clear explanations of the situation. With FP/DG, this breaks down and I believe the best one can do is to implement contracts as run-time checks in the callee, just as it is done in D. There is also a mixed strategy: to u