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

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

Thread Previous | Thread Next
Sam Vilain
May 17, 2005 18:10
Re: Quick question: '1.28' * '2.56'
Message ID:
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


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