Issue #12141 has been updated by Jrg W Mittag.


Martin Drst wrote:
> I agree with Yusuke. The name `__send__` is chosen explicitly to show that this is an 'internal' method with special status.

Also, the messaging metaphor is at the core of Smalltalk-style OOP. And the very heart of this metaphor is precisely that you do *not* "call" or "invoke" methods, but rather send messages to objects which then may or may not invoke a method *for you* in response to that message, and that method may or may not have the same name as the message. Or, they may forward the message to somewhere else. Or, they may ignore the message.

----------------------------------------
Feature #12141: send and __send__
https://bugs.ruby-lang.org/issues/12141#change-57413

* Author: Sebastian Herm
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
Hi guys !

We have this concept of sending messages to objects with `Object#send`, and that's fine, but often a child class defines its own send method, so that's why we have this ugly `Object#__send__` hack.

So, I suggest dropping `Object#__send__` and aliasing `Object#send` to `Object#invoke` instead, which seems to me as a better evocative method name.

Good or bad idea ?

Thanks !



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>