At 9:37 PM +0000 2/3/03, Nicholas Clark wrote:
It's a little more confusing that that. When I said only one foo method, it was in contrast to attributes, where an attribute of a particular name may appear in an object multiple times--since attributes are class-private, each class in an object's inheritance hierarchy can safely have an attribute named "foo".On Mon, Feb 03, 2003 at 12:15:32PM -0500, Dan Sugalski wrote:*) Method: Some sort of action that an object can do. Methods are global and public--only one foo method for an object. Methods may be inherited from parent classes, or redefined in a particular class. Redefined methods hide parent class methods of the same nameMethods may dispatch based on call signatureThe interpreter must get in the way of method dispatching, as everyone gets multimethod dispatch like it or not (though you don't have to use it)You appear to contradict yourself. How can their be multimethods, if only one method named "foo" is allowed per object? (And should I read "object" as "[object's] class" in the general case?) Or am I confused - are multimethods actually subroutines, and hence not part of a class?
Methods and properties, being global, override each other--a child class' foo overrides its parent's foo. If the child's foo has multiple definitions based on signature, or we have foo that crosses class lines, then the multiple dispatch logic comes online and does its Weird Magic.
Rereading that, it still doesn't make much sense, but there you go... :)
--
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk