From: "David A. Black" Date: 2007-11-12T06:45:42+09:00 Subject: Re: method names in 1.9 Hi -- On Mon, 12 Nov 2007, Charles Oliver Nutter wrote: > David Flanagan wrote: >> IIRC, the reason for a visiblity-honoring method is so that if your intent >> is to invoke a (public) method that is part of a published API you won't >> inadvertently invoke a (private) implementation-dependent helper method >> with the same name defined by a subclass. You fail fast with an exception >> rather than getting unexpected behavior that comes from calling the wrong >> method. > > I thought it might be something like that. For that purpose, invoke_method > seems reasonable, since it does say to me "please invoke this method as > though I were calling it", and I'd expect the same rules to apply. But "calling it" still really means "sending a message to the object"; there's always that double articulation. It would be tiresome to make oneself say that all the time, but for these somewhat low-level operations, where one is manipulating messages/method-names symbolically and explicitly sending them to the object, I prefer not to have the message/method distinction concealed. "call_method" would, I think, be better than "invoke_method". It suffers from the same problem, but I've noticed that people tend to translate "invoke" to "call" in describing it anyway, so at least it would be closer to the most common terminology. It still feels like it requires translation or dereferencing, so to speak, before it expresses precisely what the operation is doing (unlike "send"). David -- Upcoming training by David A. Black/Ruby Power and Light, LLC: * Advancing With Rails, Berlin, Germany, November 19-22 * Intro to Rails, London, UK, December 3-6 (by Skills Matter) See http://www.rubypal.com for details!