At 6:25 PM +0000 2/3/03, Andy Wardley wrote:
Dan Sugalski wrote much sense, including these gems:
*) 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 name
What about redefining methods for a particular object instance?
Nope.
It's something that Ruby does and can be extremely useful.
Ruby cheats and makes a transparent subclass, which is what we'll
have to do if we want that same functionality.
> Properties and methods share a namespace, and methods win. If I do:
a = foo.bar;
I'll call the bar method of foo if foo has a bar method, otherwise
I'll fetch the bar property. Python does this (right?) and Perl 6
will do this. (Yes, it will. Inside information, trust me. Unless
that changes this week...)
Will there be some way to explicitly indicate that one is required
but not the other? I can imagine times when you would want to access
a property but not have it masked by a method, or call a method if it
exists but not fall back on a property.
Yeah, I think there should be for those specialized cases. (And for
inspectors and other low-level thing grubbers)
> Code must be able to fetch a handle on a particular method for
later calling
By this I presume you mean that the handle would be frozen to the method
as it was when then handle was fetched? If you later re-define the method,
the handle would remain pointing at the original method, not the new one.
Yup.
--
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk