From: Dave Thomas Date: 2000-12-04T03:11:34+09:00 Subject: [ruby-talk:6781] Re: printing/accessing arrays and hashes matz@zetabits.com (Yukihiro Matsumoto) writes: > Hi, > > In message "[ruby-talk:6769] Re: printing/accessing arrays and hashes" > on 00/12/04, Dave Thomas writes: > > |> Probably Hash#fetch equivalent for Array is good answer. What do you > |> guys think is the best name for it? Array#get? Array#fetch? > | > |at (for the Smalltalkers out there). > > Ruby already has Array#at which only gives an element, not a > subarray. Yeah - I was thinking of extending it to accept ranges and/or a length parameter, but the real difference would be throwing IndexError. However, that would really be an unacceptable change of semantics in retrospect, so I guess I'd fall back on Array#fetch. Dave