John M. Dlugosz wrote: > Moritz Lenz moritz-at-casella.verplant.org |Perl 6| wrote: >> >> This is described in depth in "Object oriented software construction" by >> Bertrand Meyer. >> >> > OK, reading about it in Wiki, I see what it's supposed to do. > > PRE - derived classes may weaken but not strengthen. > > So if it fails, but the preconditions of the same method on the base > class pass, that means you wrote the precondition wrong.
No. Only if it *always* fails. PRE conditions between a class and its ancestors are OR'ed - there's nothing wrong if one part of an OR branch evaluates to false. > Rather than > ignoring that, shouldn't it be an error? Only if the compiler can prove that the condition is always false. -- Moritz Lenz http://moritz.faui2k3.org/ | http://perl-6.de/
signature.asc
Description: OpenPGP digital signature