From: "John Lam (CLR)" Date: 2007-07-03T10:27:13+09:00 Subject: Array#values_at bug? --_000_372109E149E8084D8E6C7D9CFD82E06329CECEFD0FNAEXMSGC115re_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable a =3D [1,2,3,4] a[2..4].should =3D=3D [3,4] but a.values_at(2..4).should =3D=3D [3,4,nil] The latter behavior does not feel consistent at all, especially since a.values_at(2..5).should =3D=3D [3,4,nil] IronRuby right now just calls slice() in a loop to implement values_at. Is = this what MRI does? Thanks, -John --_000_372109E149E8084D8E6C7D9CFD82E06329CECEFD0FNAEXMSGC115re_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

a =3D [1,2,3,4]

 

a[2..4].should =3D=3D [3,4]

 

but

 

a.values_at(2..4).should =3D=3D [3,4,nil]

 

The latter behavior does not feel consistent at all, especially since

 

a.values_at(2..5).should =3D=3D [3,4,nil]

 

IronRuby right now just calls slice() in a loop to imp= lement values_at. Is this what MRI does?

 

Thanks,

-John

 

--_000_372109E149E8084D8E6C7D9CFD82E06329CECEFD0FNAEXMSGC115re_--