Hi,
In message "Re: [ruby-cvs:18323] ruby: * eval.c (splat_value): use "to_splat" instead of "to_ary" to"
on Sun, 8 Oct 2006 14:05:30 +0900, Mathieu Bouchard <matju / artengine.ca> writes:
|> Could you explain how to_splat be bad?
|
|It makes one more thing to remember about Ruby 1.9, which is a bigger
|language than Ruby 1.8, which is a bigger language than Ruby 1.6. You
|don't have to compete with Perl 6, and you don't even have to compare Ruby
|2 to Perl 6 thinking how much simpler Ruby 2 is.
Every language grows in more recent version, as Ruby does, and PL/I
did, until it grows too much to collapse into a black hole by its own
gravity. It's kind a like destiny. Otherwise the language will die.
For people who don't like growing languages, the current 1.8 was
forked off from the development line (or perhaps, 1.9 was forked off
from the stable line). They will be happy using "stable" Ruby.
|> to_a was too general. All enumerable objects (and even more) have
|> to_a method.
|
|If I put a star in front of an expression in an argument-list, what else
|can it say than "splat me" and why should you feel a duty to prevent it?
I don't think I prevent anything. I just allowed objects to respond
the order "splat me" in its own manner. I considered it adding
flexibility. You can ignore it for most of the cases. Only few
people who create a new array-like object need to care.
|> to_ary was too narrow. Only array compatible objects have to_ary.
|> I wanted something in between.
|
|Could you explain why you want something in between? If you don't want
|to_a here, then what could you want the splat operator to do which is not
|something easily cured by just appending ".to_a" to the expression that
|you want to splat?
Implicit is better than explicit (under some condition), since
succinctness is power.
matz.