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

Re: Messing with the type heirarchy

Thread Previous | Thread Next
Luke Palmer
July 30, 2005 23:07
Re: Messing with the type heirarchy
Message ID:
On 7/27/05, Larry Wall <> 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.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About