From: Robert Dober Date: 2006-09-18T18:48:58+09:00 Subject: Re: Splat, #to_ary and #to_a ------=_Part_125422_33508826.1158572868057 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 9/18/06, dblack@wobblini.net wrote: > > Hi -- > > On Mon, 18 Sep 2006, Yukihiro Matsumoto wrote: > > > Hi, > > > > In message "Re: Splat, #to_ary and #to_a" > > on Mon, 18 Sep 2006 12:28:18 +0900, "Rick DeNatale" > > writes: > > > > |Just what is the fix in 1.9. > > | > > |Are you saying that > > |[*"foo\nbar"] #=3D> ["foo\nbar"] > > |in 1.9? > > > > Yes. And if you are curious you can try it by yourself. > > > > |How about: > > |[*(1..4)] > > |which in 1.8.x produces [1, 2, 3, 4] > > > > Currently, > > > > [1..4] > > > > This may be an issue. > > I've always thought it was convenient to have [*x] do the expanding > on x (including strings and ranges). But if it's going to disappear, > I think it should disappear consistently, so that * doesn't start > having a totally different meaning depending on the operand's class. I have found, and it seems it was not a common concern, that Range and <=3D= > and #succ are too closly coupled, but that is OT, I think it would be a nice opportunity to define the protocol for *, cleanl= y and giving the community the opportunity to express the fors and againsts about potential implementations, well the good ol' ML stuff ;) Personally I thought the #to_a protocol is perfect, but #to_a is not. Cheers Robert 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 > > --=20 Deux choses sont infinies : l'univers et la b=EAtise humaine ; en ce qui concerne l'univers, je n'en ai pas acquis la certitude absolue. - Albert Einstein ------=_Part_125422_33508826.1158572868057--