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

Re: Quick question: '1.28' * '2.56'

Thread Previous | Thread Next
From:
Sam Vilain
Date:
May 17, 2005 18:10
Subject:
Re: Quick question: '1.28' * '2.56'
Message ID:
428A95EF.2030604@vilain.net
Rob Kinyon wrote:
> If that's the case, then if I change a variable that isa Str (that isa
> Num), does it change what it inherits from?

Please don't use "inherits" when talking about these core types.  Classical
inheritance just doesn't work with the varied sets of numbers.  All those
stories you were told about Classical Inheritance being able to describe any
problem were naïve lies.  Roles-based inheritance (or Traits-based if you
like Smalltalk, or Haskell's Classes) is a superset of classical inheritance.

In fact it seems reasonable to me at this point in time that a Perl 6 Class
is a subtype of a Role.  The distinctions seem minor enough not to matter.

See also http://svn.openfoundry.org/pugs/docs/src/number-types.png

Sam.

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