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

Re: Messing with the type heirarchy

Thread Previous | Thread Next
From:
Dave Whipp
Date:
July 31, 2005 10:40
Subject:
Re: Messing with the type heirarchy
Message ID:
20050731174038.9022.qmail@lists.develooper.com
Luke Palmer wrote:

>>>Everything that is a Num is a Complex right?
>>
>>Not according to Liskov ....  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.

Doesn't the problem largely go away if we allow Num to be a more general 
numeric type, and introduce, say, Real for the more constrained set of 
numbers that Num currently represents. Of course, if it were truely the 
most general, then it'd permit quaternions, etc., but I think that most 
people would be happy for Num to be a simplest possible complete 
arithmetic type.

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