From: Jordi Date: 2007-11-13T19:45:07+09:00 Subject: Re: method names in 1.9 On Nov 13, 2007 7:28 PM, Michal Suchanek wrote: > On 12/11/2007, David A. Black wrote: > > Hi -- > > > > On Mon, 12 Nov 2007, Jordi wrote: > > > > > Summing it up: > > > > > > - Surprising or not, sending messages is not the same that calling > > > methods in Ruby (there is a real difference, see method_missing email > > > of Matthew in this thread). > > > - Honoring visibility is not the same that don't honoring it (obviously) > > > > > > So, we can have potentially 4 operations in Ruby 1.8.x: > > > > > > 1.- Call method honoring visibility > > > 2.- Call method not honoring visibility > > > 3.- Send message honoring visibility > > > 4.- Send message not honoring visibility > > > > I don't see how 1/2 differ from 3/4, except in the terminology. What > > we call "calling a method" on an object *is* sending a message. > > There's no choice on the programmer's part. The distinction is really > > from the object's perspective. > > > > > > As far as I can understand it there are two features we might (not) > want when sending a message: > - to honor visibility > - to let the object handle the message with method_missing if there > is no matching method defined > > 0) Normally, the . operator uses both features. There might be uses > for other options as well. > > In my view there is option needed > 1) for sending a message as if it was done with the . operator but > with dynamic method name without using eval (at least directly) > 2) for sending a message as above that is not handled by > method_missing. This defeats the use of proxy objects but will be > probably useful for implementation of the proxy objects. > I can't understand your last sentence. I also can not think of a real world case where I would like to bypass method_missing (you can just don't implement it) I think all this discussion is not that difficult. We need "." for normal message sending and "send" or a more accurate name for not honoring visibility for compatibility. Anything else should be a synonym of one of the above. And yes, you are right, naming conventions are important. That's why "invoke_method" is awful as well as "send" when we are receiving. Not to mention that send should have ! (maybe not-honoring visibility send was an implementation error long time ago and not a feature) -- Jordi