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

 Unless I missed something, child classes inherit parent class roles,
 so if I have Foo with a role of X, and Bar inherits from Foo, Bar
 does the X role. Looks like inheritance to me...

That's normal inheritance and that's fine.


Consider instead a class that does a role but does not inherit anything.

I am.


You're mixing things up some here. Larry's way of presenting roles at the language level likely is contributing.

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.

Larry's role stuff muddles that up. You end up with a Role X which is the class X with X on the does list. Therefore X isa X *and* does X. If you inherit from X your class does X as well.

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.

That's how things are going to work. It's possible (even likely) that we don't have the does searching right, but if not we just need to fix that.
--
Dan


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

Reply via email to