On 4/19/04 10:04 PM, Damian Conway wrote:
> John Siracusa wrote:
>> I'd either like a way to more cleanly extend the default accessor's
>> assignment behavior down the road (i.e. by just writing a new name() method,
>> not by hacking away at STORE traits and adding private worker subs) or a way
>> to auto-generate the slightly more "boring" default accessor shown above.
> 
> There *is* a way to do the latter. In A12, Larry implies that the declarators
> in the body of a class definition are actually method calls on an instance of
> MetaClass [...] So, presumably, by defining a new C<scope_declarator:has>, you
> would be able to override the default accessor-generating behaviour.

Ooo, that would be neat.

> The least scary way to do this would be to encapsulate it in a trait that is
> applied to (and has its way with ;- the class declaration [...] or perhaps is
> applied instead to individual attribute declarations

Either of those looks okay...well, maybe "Damian okay" which is a slightly
different standard ;)

> Alternatively, you could just *cheat* and define a macro

That's a bit much for me.  I mean, yeah, sure, you can basically do
"anything" that way, but come on.  I dread what you will do with (or is that
"to") Perl 6 once it's released... ;)

-John

Reply via email to