From: Jeff Wood Date: 2005-11-26T21:29:48+09:00 Subject: Re: Faster way to pick the every other array member? ------=_Part_10126_3801446.1133008181711 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Other than having to do the * that's very cool. It should be smart enought to figure out input param types .... or maybe add to the syntax for ranges ? ( 2..6 by 2 ) could be cool too Anyways, thanks for the note about 1.9 j. On 11/25/05, Mauricio Fern=E1ndez wrote: > > On Sat, Nov 26, 2005 at 09:13:38AM +0900, Jeff Wood wrote: > > I'm kind of surprised that you don't get an array of values back if you > call > > Range#step(x) without a block. > > > > That would make things much easier ... > > > > a.values_at( (2..6).step(2) ) > > > > ... at least, that is what would make sense to me ... anybody else? > > a =3D (0..20).to_a > a.values_at( *(2..6).step(2) ) # =3D> [2, 4, 6] > RUBY_VERSION # =3D> "1.9.0" > > -- > Mauricio Fernandez > > -- "Remember. Understand. Believe. Yield! -> http://ruby-lang.org " Jeff Wood ------=_Part_10126_3801446.1133008181711--