From: "David A. Black" Date: 2005-07-22T19:49:34+09:00 Subject: Re: Odd Array#[x..y] return values Hi -- On Fri, 22 Jul 2005, daz wrote: > > Daniel Berger wrote: >> Hi all, >> >> Ruby 1.8.2 >> >> Consider: >> >> irb(main):001:0> a = [] >> => [] >> irb(main):002:0> a[0..1] >> => [] >> irb(main):003:0> a[-2..-1] >> => nil >> >> Why does the first return [] and the second return nil? >> > > > Archive reading: > http://groups.google.com/groups?threadm=BAY22-F7pSWerOc0Ne000000288@hotmail.com I'll perhaps superfluously report the results of my digging, as long as I've done it :-) See the ruby-talk threads starting at: 10136 24700 84973 In the first of these, Matz talks about the index pointing at an (imaginary) edge between elements. David -- David A. Black dblack@wobblini.net