HaloO,

Ovid wrote:
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?

I think you'll need an intermediate class that you use to apply your
role. Classes are open and that implies the possibility to merge
further roles into them. But this applies for all users of the class.
How this works when there are already instances I don't know.


Second, how can I remove roles from classes?

Is that a wise thing to do? Roles are not assigned and removed
as a regular operation. What is your use case?


Regards, TSa.
--

Reply via email to