Austin Hastings writes:
> One of the things that got a little less clear with A12 was the idea of
> multiple C<is> clauses.
>
> Once upon a time, we talked about:
>
> my $spot is Dog is const is persistent is ...;
>
> Obviously some of those are traits, now. However, I'm wondering how to
> handle things like my recent suggestion of a class (metaclass instance) that
> generated different accessor behavior.
>
> The obvious way was:
>
> use GrammarMod;
> # use AccessorClass;
>
> NewKeyword thing {...}
> # accessor_class thing {...}
>
> but isn't there a better way? In particular, is there some way for the trait
> to declare that it modifies the metaclass, not the class, so that:
>
> use GrammarMod;
> # use AccessorClass;
>
> class thing is NewKeyword {...}
> # class Obj is accessor_class { has $.foo is rw; }
I imagine you would just replace $.meta in the argument to
trait_auxiliary:is.
Or you could just define a new scope_declarator that knew how to modify
the class appropriately.
Luke