ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:74116] [Ruby trunk Feature#12141] send and __send__
       [not found] <redmine.issue-12141.20160303211729@ruby-lang.org>
@ 2016-03-03 21:17 ` se8ast
  2016-03-03 21:21 ` [ruby-core:74117] " se8ast
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 10+ messages in thread
From: se8ast @ 2016-03-03 21:17 UTC (permalink / raw
  To: ruby-core

Issue #12141 has been reported by Sebastian Herm.

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

* 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/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:74117] [Ruby trunk Feature#12141] send and __send__
       [not found] <redmine.issue-12141.20160303211729@ruby-lang.org>
  2016-03-03 21:17 ` [ruby-core:74116] [Ruby trunk Feature#12141] send and __send__ se8ast
@ 2016-03-03 21:21 ` se8ast
  2016-03-03 21:29 ` [ruby-core:74118] " se8ast
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 10+ messages in thread
From: se8ast @ 2016-03-03 21:21 UTC (permalink / raw
  To: ruby-core

Issue #12141 has been updated by Sebastian Herm.


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 !

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

* 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/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:74118] [Ruby trunk Feature#12141] send and __send__
       [not found] <redmine.issue-12141.20160303211729@ruby-lang.org>
  2016-03-03 21:17 ` [ruby-core:74116] [Ruby trunk Feature#12141] send and __send__ se8ast
  2016-03-03 21:21 ` [ruby-core:74117] " se8ast
@ 2016-03-03 21:29 ` se8ast
  2016-03-04  7:02 ` [ruby-core:74127] " shevegen
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 10+ messages in thread
From: se8ast @ 2016-03-03 21:29 UTC (permalink / raw
  To: ruby-core

Issue #12141 has been updated by Sebastian Herm.


Sorry, hard time editing/formating my post !

:-(

But I hope you understand what I mean !

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

* 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/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:74127] [Ruby trunk Feature#12141] send and __send__
       [not found] <redmine.issue-12141.20160303211729@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2016-03-03 21:29 ` [ruby-core:74118] " se8ast
@ 2016-03-04  7:02 ` shevegen
  2016-03-04  7:03 ` [ruby-core:74128] " shevegen
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 10+ messages in thread
From: shevegen @ 2016-03-04  7:02 UTC (permalink / raw
  To: ruby-core

Issue #12141 has been updated by Robert A. Heiler.


I think this could only be done in ruby 3.x

But I believe that .send will remain because it is super short. :)

In the later ruby days, people added .public_send but .send is still so
much shorter to use and write; .invoke would also be longer to type. :D

The statement that classes often define their own .send is not true though.

I think for 5000 ruby classes that I may have written so far in 12 years 
or so, I could not recall any more instance than one or two at max where
I would need a custom .send nor __send__ - it seems very specialized 
and thus I don't think this warrants a change of the name .send() - but
that is of course just my own personal opinion here.

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

* 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/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:74128] [Ruby trunk Feature#12141] send and __send__
       [not found] <redmine.issue-12141.20160303211729@ruby-lang.org>
                   ` (3 preceding siblings ...)
  2016-03-04  7:02 ` [ruby-core:74127] " shevegen
@ 2016-03-04  7:03 ` shevegen
  2016-03-04 12:49 ` [ruby-core:74137] " se8ast
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 10+ messages in thread
From: shevegen @ 2016-03-04  7:03 UTC (permalink / raw
  To: ruby-core

Issue #12141 has been updated by Robert A. Heiler.


Hmm the second send that appears in bold is a __ send __  - it seems
as if rubymine interpretes this as bold, sorry.

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

* 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/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:74137] [Ruby trunk Feature#12141] send and __send__
       [not found] <redmine.issue-12141.20160303211729@ruby-lang.org>
                   ` (4 preceding siblings ...)
  2016-03-04  7:03 ` [ruby-core:74128] " shevegen
@ 2016-03-04 12:49 ` se8ast
  2016-03-04 13:25 ` [ruby-core:74138] " nobu
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 10+ messages in thread
From: se8ast @ 2016-03-04 12:49 UTC (permalink / raw
  To: ruby-core

Issue #12141 has been updated by Sebastian Herm.


Thanks for your feedback. :-)

I agree, it's a minor (cosmetic) issue. For example, Rails uses __ send __ only 17 times in its huge codebase. :-)

I don't suggest removing send, but just replacing __ send __ with invoke to have a better named alias (yes, maybe for Ruby 3.0 ?)

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

* 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/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:74138] [Ruby trunk Feature#12141] send and __send__
       [not found] <redmine.issue-12141.20160303211729@ruby-lang.org>
                   ` (5 preceding siblings ...)
  2016-03-04 12:49 ` [ruby-core:74137] " se8ast
@ 2016-03-04 13:25 ` nobu
  2016-03-04 13:42 ` [ruby-core:74139] " mame
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 10+ messages in thread
From: nobu @ 2016-03-04 13:25 UTC (permalink / raw
  To: ruby-core

Issue #12141 has been updated by Nobuyoshi Nakada.

Description updated

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

* 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/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:74139] [Ruby trunk Feature#12141] send and __send__
       [not found] <redmine.issue-12141.20160303211729@ruby-lang.org>
                   ` (6 preceding siblings ...)
  2016-03-04 13:25 ` [ruby-core:74138] " nobu
@ 2016-03-04 13:42 ` mame
  2016-03-05  5:19 ` [ruby-core:74156] " duerst
  2016-03-14  1:32 ` [ruby-core:74291] " Ruby-Lang
  9 siblings, 0 replies; 10+ messages in thread
From: mame @ 2016-03-04 13:42 UTC (permalink / raw
  To: ruby-core

Issue #12141 has been updated by Yusuke Endoh.


I can't understand this issue.  You know there is `__send__` because `send` is often overridden.  Then, why do you think `invoke` is okay?  We can easily find a lot of cases that `invoke` is defined.

https://github.com/ruby/rake/blob/78d81799ad0b440478f6a99ff9af36ea131bda90/lib/rake/task.rb#L171
https://github.com/search?l=ruby&q=%22def+invoke%22&ref=searchresults&type=Code&utf8=%E2%9C%93

-- 
Yusuke Endoh <mame@ruby-lang.org>

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

* 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/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:74156] [Ruby trunk Feature#12141] send and __send__
       [not found] <redmine.issue-12141.20160303211729@ruby-lang.org>
                   ` (7 preceding siblings ...)
  2016-03-04 13:42 ` [ruby-core:74139] " mame
@ 2016-03-05  5:19 ` duerst
  2016-03-14  1:32 ` [ruby-core:74291] " Ruby-Lang
  9 siblings, 0 replies; 10+ messages in thread
From: duerst @ 2016-03-05  5:19 UTC (permalink / raw
  To: ruby-core

Issue #12141 has been updated by Martin Dürst.


I agree with Yusuke. The name __ send __ is chosen explicitly to show that this is an 'internal' method with special status.

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

* 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/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:74291] [Ruby trunk Feature#12141] send and __send__
       [not found] <redmine.issue-12141.20160303211729@ruby-lang.org>
                   ` (8 preceding siblings ...)
  2016-03-05  5:19 ` [ruby-core:74156] " duerst
@ 2016-03-14  1:32 ` Ruby-Lang
  9 siblings, 0 replies; 10+ messages in thread
From: Ruby-Lang @ 2016-03-14  1:32 UTC (permalink / raw
  To: ruby-core

Issue #12141 has been updated by Jörg W Mittag.


Martin Dürst 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/

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-03-14  0:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <redmine.issue-12141.20160303211729@ruby-lang.org>
2016-03-03 21:17 ` [ruby-core:74116] [Ruby trunk Feature#12141] send and __send__ se8ast
2016-03-03 21:21 ` [ruby-core:74117] " se8ast
2016-03-03 21:29 ` [ruby-core:74118] " se8ast
2016-03-04  7:02 ` [ruby-core:74127] " shevegen
2016-03-04  7:03 ` [ruby-core:74128] " shevegen
2016-03-04 12:49 ` [ruby-core:74137] " se8ast
2016-03-04 13:25 ` [ruby-core:74138] " nobu
2016-03-04 13:42 ` [ruby-core:74139] " mame
2016-03-05  5:19 ` [ruby-core:74156] " duerst
2016-03-14  1:32 ` [ruby-core:74291] " Ruby-Lang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).