: Problem:
:
: You want to use delegation rather than inheritance to
: add some capabilities of one class or object to
: another class or object.
:
: Solution:
:
: Use a PROXY block:
:
: class MyClass {
:
: PROXY {
: attr $left_front_wheel is Wheel;
: attr $right_front_wheel is Wheel;
:
: when 'steer' { $left_front_wheel, $right_front_wheel }
: }
: ...
: }
I think this is falling into the "use overload <gobbledygook>" trap.
If something is part of the method interface, it ought to be declared
as a method. It's the *implementation* syntax that should be screwed
around with to do delegation. Something like:
method steer is really(Wheel) is also(???) { .profit!!! }
I guess now we need C<???> and C<!!!> tokens now to go with C<...>.
:::---)))
Larry