At 11:51 AM -0800 3/16/04, chromatic wrote:
On Tue, 2004-03-16 at 11:46, Dan Sugalski wrote:

 A class >does< X if X is on the does list of the class or any of the
 parents of the class. This class then does the role X.

 A class >isa< X if X in on the isa list of the class or any of the
 parents  of the class.

 Alternately, your class can just declare that it does X and thus
 *only* put X on  its does list. Then that class or any child class is
 noted as doing X, without actually being an X.

As long as there are separate does and isa lists, it can work right.


Just to be sure, if Class Y inherits from Class X, is X on Y's does
list?

If class X does X, then yes. (I *really* should've picked better names) Classes don't by default do themselves, so if you had a top-level class Foo that didn't mark itself as doing anything, an object of class Foo would return true for an isa('Foo') check but false for a does('Foo') check.


Classes and roles don't automatically share the same namespace.
--
                                        Dan

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

Reply via email to