J
Jim Freeze
Hi
I am puzzling about the following:
ruby -v -e 'p [][0..0]; p [][0..-1]; p [][-1..-1]'
ruby 1.8.0 (2003-08-04) [sparc-solaris2.8]
[]
[]
nil
If ary[n..n] returns a slice, then why does a[0..0] give
me an empty array and a[-1..-1] give me nil?
--
Jim Freeze
If you live to the age of a hundred you have it made because very few
people die past the age of a hundred.
-- George Burns
I am puzzling about the following:
ruby -v -e 'p [][0..0]; p [][0..-1]; p [][-1..-1]'
ruby 1.8.0 (2003-08-04) [sparc-solaris2.8]
[]
[]
nil
If ary[n..n] returns a slice, then why does a[0..0] give
me an empty array and a[-1..-1] give me nil?
--
Jim Freeze
If you live to the age of a hundred you have it made because very few
people die past the age of a hundred.
-- George Burns