I would assume that all classes automatically define:

 multi submethod *infix:<as> ($self: $?CLASS) { $self }

so that derived classes can automatically:

 $obj.as<ancestor>

Without actually changing their implementation details (only the type
that Perl currently thinks it's dealing with polymorphically).

In fact, I would expect that this bit of behind-the-curtain magic is how
the MCP arranges for polymorphism when you:

 sub foo(Object $x) {...}
 my A $y;
 foo($y);

Is all of that fair?

-- 
Aaron Sherman <[EMAIL PROTECTED]>
Senior Systems Engineer and Toolsmith
"We had some good machines, but they don't work no more." -Shriekback


Reply via email to