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.

Reply via email to