> First, when a role is applied to a class at runtime, a instance of that
> class in another scope may specifically *not* want that role.  Is there a
> way of restricting a role to a particular lexical scope short of applying
> that role to instances instead of classes?

Seems like you could use an empty intermediate role to accomplish the same 
thing while leaving the shared class alone.

Shared Class A
Mixin Role B

Class C isa A does B
Class D isa A

Shared Class A is unmodified.

Otherwise, I think that any runtime modification of a class should affect all 
instances and future instances of that class.

On closer inspection, is it even possible to add a Role to a Class at runtime?  
I thought that Class and Role composition outside of compile time resulted in 
a new pseudo Class for the subsequent instances of that composition - in 
which case the original Class would remain unmodified.


Reply via email to