On Sat, Dec 13, 2003 at 12:07:40PM -0500, Austin Hastings wrote:
: > From: Larry Wall [mailto:[EMAIL PROTECTED]
: > The behavior probably doesn't expire unless you've cloned the object
: > and the clone expires.  However, if a role goes out of its lexical
: > scope, it can't be named, so it's effectively not usable unless you
: > dig out a name for it via reflection.  But the information is still
: > cached there, so the object could be smarter the next time it takes
: > on the same role.
: 
: It's a role closure, in other words?

Erm.  That's a fancy word, and I don't claim to know what it means
all the time.  I suspect the name of the role is closed but the role
itself isn't.  Alice: "If the name of the role is called Teach..."

: That being the case, how to you unapply a role?
: 
:   $frank does no Teach;
: 
:   $frank doesnt Teach;

$frank.role_manager(
        action => "delete",
        mode => "override_all_safety_mechanisms", 
        name_the_role_is_called => "Teach"
    );

Or something like that.  :-)

: > That being said, a role applied with C<temp> probably *should* be
: > stripped out when it goes out of scope.  Could get messy though...
: 
: I can't think of a way to apply a role with temp (to a non-temp object). How
: do you do it?

Well, we did set up a way for a method to be temporizable, so it
probably comes down to whether C<but> is just syntactic sugar for a
method call that knows how to undo itself.

Larry

Reply via email to