From: Harry Kakueki Date: 2009-08-03T17:38:47+09:00 Subject: Re: Inconsistency in Array#[] On Mon, Aug 3, 2009 at 5:17 PM, Bertram Scharpf wrote: > Hi, > > Am Montag, 03. Aug 2009, 09:11:11 +0900 schrieb Bertram Scharpf: >> Am Montag, 03. Aug 2009, 05:50:10 +0900 schrieb Wojciech Piekutowski: >> > a = [1,2,3,4,5] >> > >> I would even prefer a behaviour like this: >> >> a[3,-3] #=> [4,3,2] >> >> This would be the least surprise to me. > > Sorry! The least surprise of course would be > > a[3,-3] #=> [3,2,1] > > Bertram > > > -- > Bertram Scharpf > Stuttgart, Deutschland/Germany > http://www.bertram-scharpf.de > > Really? a = [1,2,3,4,5] p a[3,2] #=> [4, 5] #p a[3,-3] #=> [4,3,2] #a[start,length] This seems least surprising to me. Harry -- A Look into Japanese Ruby List in English http://www.kakueki.com/ruby/list.html