Re: Virtual methods

2005-05-26 Thread Aaron Sherman
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

Re: Virtual methods

2005-05-25 Thread Piers Cawley
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

Re: Virtual methods

2005-05-18 Thread Aaron Sherman
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

Re: Virtual methods

2005-05-18 Thread Luke Palmer
; > 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

Virtual methods

2005-05-18 Thread Aaron Sherman
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