From: Mathieu Bouchard Date: 2006-10-08T14:05:30+09:00 Subject: Re: [ruby-cvs:18323] ruby: * eval.c (splat_value): use "to_splat" instead of "to_ary" to --8323328-179759832-1160283619=:13122 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-179759832-1160283619=:13122" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-179759832-1160283619=:13122 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Wed, 4 Oct 2006, Yukihiro Matsumoto wrote: > on Wed, 4 Oct 2006 21:51:05 +0900, Mathieu Bouchard = writes: > |Reminds me of "List Context" in Perl. > |I thought that pretty much everybody was against that feature of Perl. > Hmm, even if to_splat remind you list context in Perl, it does not > mean to_splat is bad. right. > Could you explain how to_splat be bad? It makes one more thing to remember about Ruby 1.9, which is a bigger=20 language than Ruby 1.8, which is a bigger language than Ruby 1.6. You=20 don't have to compete with Perl 6, and you don't even have to compare Ruby= =20 2 to Perl 6 thinking how much simpler Ruby 2 is. > 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=20 can it say than "splat me" and why should you feel a duty to prevent it? > 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=20 to_a here, then what could you want the splat operator to do which is not= =20 something easily cured by just appending ".to_a" to the expression that=20 you want to splat? _ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - t=E9l:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montr=E9al QC Canada --8323328-179759832-1160283619=:13122-- --8323328-179759832-1160283619=:13122--