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;
> > giv
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 cla
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 alwa
;
> This gives you a form of auto-loading like delegation, but with less
> storage overhead (since there's no encapsulation until you need it).
> Here's an example:
>
> role X {
> has Str $.string handles;
> # I'll write s
no encapsulation until you need it).
Here's an example:
role X {
has Str $.string handles;
# I'll write something like an accessor to avoid brining
# up some questions around how virtual methods interact
# with au