From: "David A. Black" Date: 2004-09-20T10:19:46+09:00 Subject: Re: Array#index block and rdetect Hi -- On Mon, 20 Sep 2004, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: Array#index block and rdetect" > on Mon, 20 Sep 2004 00:39:42 +0900, "Robert Klemme" writes: > > |> Couldn't the index of a hash be considered the key? So the block of #index > |> when applied is the value. i.e. > | > |Good idea! That way Hash and Array are partly interchangable. You could > |view an array as a special case of an associative storage with the > |restriction that keys are ints. > > In that case, Hash#each and Enumerable#each_with_index should be > redefined for consistency. Could #each_with_index be left to individual classes, as #each_index is? David -- David A. Black dblack@wobblini.net