On Wed, 2005-05-25 at 09:11, Piers Cawley wrote:
Aaron Sherman [EMAIL PROTECTED] writes:
There are many gotchas that fall out of that. For example, you might
have a special role that overrides .print to handle structured data, so
your code says:
my Foo $obj;
given $obj {
Aaron Sherman [EMAIL PROTECTED] writes:
On Wed, 2005-05-18 at 10:51, Luke Palmer wrote:
Except that mixins like this always treat things as virtual.
Whenever you mixin a role at runtime, Perl creates an empty, anonymous
subclass of the current class and mixes the role in that class. Since
it).
Here's an example:
role X {
has Str $.string handlesucfirst;
# I'll write something like an accessor to avoid brining
# up some questions around how virtual methods interact
# with auto-accessors just yet
storage overhead (since there's no encapsulation until you need it).
Here's an example:
role X {
has Str $.string handlesucfirst;
# I'll write something like an accessor to avoid brining
# up some questions around how virtual methods interact
On Wed, 2005-05-18 at 10:51, Luke Palmer wrote:
Except that mixins like this always treat things as virtual.
Whenever you mixin a role at runtime, Perl creates an empty, anonymous
subclass of the current class and mixes the role in that class. Since
roles beat superclasses, you'll always