From: Mathieu Bouchard Date: 2001-02-16T01:45:20+09:00 Subject: [ruby-talk:10910] Re: RubyChangeRequest #U002: new proper name for Hash#indexes, Array#indexes On Thu, 15 Feb 2001, David Alan Black wrote: > Having the single index return a single value, and multiple ones return > an array, is in keeping with the behavior of #[], so in that sense it > would be consistent. Sorry, not really... a = [2,3,5,7] a[2] #=> 5, one element in single mode a[2..2] #=> [5], one element in multiple mode Another possibility is instead of #at(*indices) it could be #at(index_or_indices) where either a single value or an array of indices could be passed. that way you may distinguish between the two modes. Add another method #at!(indices) which modifies the array of indices itself, to avoid creating two arrays. (But this is not the usual meaning of "!".) Currently I still prefer #values_at(*indices) though... matju