> Gennady wrote:
>
>> data = listing.values_at(4,8)
>
> Thanks!
>
> Obviously, I should have tried
>
>    puts [].methods.sort.join("\n")

The "join" method is redundant unless you have modified the output
separator :)

> Sadly, I just use ri (and rj) and neither of them listed values_at.
> Somehow, I didn't notice Array#select in either of them; either that or
> I misread the documentation.

I'm pretty sure that ri 1.8b contains values_at.  I'm surprised about rj,
since I thought it was based on 1.8b.  Anyway, rj is becoming blissfully
redundant as Dave improves ri.  The pace of that improvement is
astonishing (see recent Ruby ChangeLog entries).

Anyway, you may want to check rdoc.sf.net to see if your 'ri' is up to
date with the latest stable release (not the new experimental stuff).

> Note: I still think that indexing an array with an array of indices is
> such an obvious thing to try that it should be there, but for the time
> being, I'll just spend some time reading through the updated
> documentation once the new ri comes out.

Not in my opinion, actually.  It makes sense once I see it, but the code
you presented is unappealing to me: too many [[ and ]] :).  But if that's
what I'd seen first in Ruby, I probably wouldn't have thought twice.

Cheers,
Gavin