develooper Front page | perl.perl6.language | Postings from July 2005

Re: Messing with the type heirarchy

Thread Previous | Thread Next
From:
Luke Palmer
Date:
July 30, 2005 23:07
Subject:
Re: Messing with the type heirarchy
Message ID:
7ca3f01605073023077d790e1c@mail.gmail.com
On 7/27/05, Larry Wall <larry@wall.org> 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

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About