From: "Guy N. Hurst" Date: 2000-12-08T03:19:01+09:00 Subject: [ruby-talk:6907] Array#rassoc question(s) In trying to understand Array#assoc and Array#rassoc, I noticed I couldn't relate it to the difference between, for example, Array#index vs. Array#rindex, in which the "r" could stand for reversed, or right-sided, because Array#rassoc has nothing to do with starting from the right side. Dave and Andy explain that it looks at the *second* element of each contained array (Array#assoc looks at the first). Of course, I start thinking maybe they are mistaken - but their example uses arrays with two elements each, which does not distinguish between "second" element, and "last" element. So I am left wondering if it really is just the second element? After testing the feature with three elements, I proved to myself that it is indeed the second element that is compared. Well, this just begs the question(s)... 1) why was Array#rassoc made to look at the second element instead of the last element? 2) doesn't the current behavior of Array#rassoc conflict with POLS? 3) how about having a method to compare the Nth element? (maybe add a parameter to Array#assoc for that purpose) I realize that I could make my own method for doing #3, but that does not address the issue in (1) and (2) Guy N. Hurst -- HurstLinks Web Development http://www.hurstlinks.com/ Norfolk, VA - (757)623-9688 PHP/MySQL - Ruby/Perl - HTML/Javascript