On 7/27/05, Larry Wall <[EMAIL PROTECTED]> wrote:
> On Wed, Jul 27, 2005 at 11:00:20AM +0000, Luke Palmer wrote:
>> Everything that is a Num is a Complex right?
> 
> Not according to Liskov.  Num is behaving more like a constrained
> subtype of Complex as soon as you admit that "isa" is about both
> implementation and interface.  By the interface definition it's
> slightly truer to say that Complex is a Num because it extends Num's
> interface.  But this is one of the standard OO paradoxes, and we're
> hoping roles are the way out of it. 

Well, everything that is a Num is a Complex in a value-typed world,
which Num and Complex are in.  I don't like reference types much
(though I do admit they are necessary in a language like Perl), and
I'm not sure how this fits there anymore.  Anyway, that's beside the
point, since a supertyping need is still there for referential types.

Luke

Reply via email to