On Nov 10, 12:02 pm, Yukihiro Matsumoto <m... / ruby-lang.org> wrote:
> Hi,
>
> In message "Re: method names in 1.9"
>     on Sun, 11 Nov 2007 00:55:48 +0900, "David A. Black" <dbl... / rubypal.com> writes:
>
> |I know that a 1.9 feature-freeze is coming soon, but I just wanted to
> |put in a last-minute plea for some method name changes or removals.
>
> - send, invoke_method
>
> #send now invokes any method regardless of visibility (as in 1.8) so
> that the alternative version of "send" (currently named
> 'invoke_method') honors visibility.  I don't think adding "bang" for
> the safer version is a good idea.  Any other idea?

Well, there's just #invoke, though that doesn't techincally address
David's concern.

But I've always thought #respond seemed an appropriate name, since it
coresponds to #respond_to? It also basically addresses Jordi's
consideration, i.e. we're asking the object nicely to 'respond' to our
request. With the other, we 'send' a message it can't so easily
refuse ;-)

> - to_splat
>
> Unlike invoke_method above, you didn't provide your sought name.  It
> must be a clear name to be use for splat.  Any opinion?
> Regarding 'to_xxx', we have 'to_open' added in 1.9 that must be
> irritate you.  It is used to implement open on anything other than
> strings.

I tend to agree with David here. For instance, I once had
Integer#to_roman, but depraecated it in favor to Integer#roman. Why is
the preposition needed? #splat seems fine. On the other hand one could
just argue that a "splat" is a form of Array, so #to_splat is just an
odd named part of the to_a and to_ary "family" of methods. Would
#to_args make us feel any better?

T.