At 2:21 PM -0500 4/22/04, Abhijit A. Mahabal wrote:
This is actually a couple of questions:
1: can you extend roles by saying: role Set is extended {}

Parrot will allow this, so if Larry says OK you're fine. It may be rather significantly expensive, however. (Not nearly as bad as, say, adding an attribute at runtime to a heavily instantiated class, but...)


2: if yes, does this change variables for which you said $var does Set?

Well, it changes the *classes* for which you said $var does Set. When you throw a role on an object we're making an anonymous sub-class, so altering the role alters the anonymous subclass rather than the object in the subclass.


In other words, is the singleton class like a closure or a first-class
class?

I'm not sure how the above questions relate to this, but singleton classes are real first-class classes.
--
Dan


--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to