--- Yukihiro Matsumoto <matz / ruby-lang.org> wrote:

> Hi,
> 
> In message "Re: Method behaves differently when called using
> #send"
>     on Tue, 30 Aug 2005 01:03:12 +0900, Yukihiro Matsumoto
> <matz / ruby-lang.org> writes:
> 
> |Because I felt they are different, as I said above.  I admit
> fcall is
> |not the best name, but very few people would use it.
> 
> OK, here's another idea.  How about
> 
>   foo.send(:bar)
> 
> calls only public methods and
> 
>   send(:bar)
> 
> calls private methods of the receiver as well?
> 
> 							matz.

Doing this would make the semantics for calling Object#send
different from every other method call.  Would these be two
different methods or one method that can somehow sense whether
it was called with a receiver?  Although I wouldn't endorse
overriding/redefining send, what would happen if one did so? 
Or would the second form not be a method call and "send" be a
new keyword instead.  Another option would be to introduce
local methods and the first Object#send would be the public
method and the second would be the local method.

I think simply separate methods is a better choice than the
confusion/complexity of the above.  It also preserves one of
the main functionalities of send - bypassing method protection
(private/protected).


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com