From: dblack@... Date: 2006-10-11T01:35:33+09:00 Subject: Re: [ruby-cvs:18323] ruby: * eval.c (splat_value): use "to_splat" instead of "to_ary" to Hi -- On Wed, 11 Oct 2006, Charles Oliver Nutter wrote: > dblack@wobblini.net wrote: >> On Tue, 10 Oct 2006, Charles Oliver Nutter wrote: >>> to_splattable (perhaps most accurate; I tend to like to_splat also) >> >> Am I the only one who thinks that "splat" is a goofy, babyish word, >> and while OK to throw around on mailing lists, really not expressive >> of anything technically specific? (The most accurate would be >> "to_splatted", but hopefully the whole thing can be avoided.) It >> would be like having File.slurp instead of File.read. > > I like the word; it's very descriptive of slamming an array against a hard > surface...the contents "splat" out into individual elements. If you want > something more technically descriptive, "expand" is your word, or perhaps > "break_into_consitutent_pieces". I like splat. > > And I figured to_splattable is more accurate because it hasn't been splatted > yet; the implementation of to_splattable returns an array that's ready to be > splatted. You could certainly call x = y.to_splattable; z = [*y]; because y > is a splattable, not a splatted. I see what you mean. I think there's been ambiguity in some of the naming suggestions, though; for instance, to_values and to_args, both of which suggest the already-finished process. In fact that's probably what was tripping me up yesterday about the relation between what's returned by this method and the star: x.to_values # an array *x.to_values # the unarrayed version which means that to_values is not unarrayed until it hits the star. Oh, I don't know. to_a is starting to look really good :-) David -- David A. Black | dblack@wobblini.net Author of "Ruby for Rails" [1] | Ruby/Rails training & consultancy [3] DABlog (DAB's Weblog) [2] | Co-director, Ruby Central, Inc. [4] [1] http://www.manning.com/black | [3] http://www.rubypowerandlight.com [2] http://dablog.rubypal.com | [4] http://www.rubycentral.org