In a message dated Fri, 4 Oct 2002, [EMAIL PROTECTED] writes:

> On Fri, Oct 04, 2002 at 09:13:45AM -0400, Chris Dutton wrote:
> > > How exactly does one "weaken" a precondition?
> >
> > At least in Eiffel, if you redefine a method, you may not give it
> > stringer preconditions than the original method, but you may have
> > stronger postconditions.  In essence, you're not requiring any more of
> > the client, but you can ensure more to them on completion, thus
> > maintaining the parent's contract.
>
> But what does it mean to be "stronger"?  How does Eiffel figure out if
> a given precondition is "stronger" or "weaker" than another?

Like I said before, boolean logic.  Preconditions are OR'd together
(starting with the deepest subclass and working back to the most ancestral
class, in order to short-circuit most effectively), postconditions are
AND'd together (in the opposite order, same reason).

You responded that it couldn't work that way in Perl because Perl has
expressions that are more complicated than booleans.  I asked you what you
meant by that, since the only definition of "passing a condition" I'm
aware of in Perl is a boolean expression returning true.  You haven't
responded to that one yet. :-)

Trey

Reply via email to