From: Jason Nordwick Date: 2006-09-14T14:02:07+09:00 Subject: Re: arbitrary indexes P.S., that is still no reason Enumerable[list] should not be allowed that I can see. a=[0,11,22,33,44,55] b=[1,3] where a[b] would return [11,33] even if this would look a little funny in its constant form: a[[1,3]] -j Eero Saynatkari wrote: > Jason Nordwick wrote: >> What would seem most natural (and best) would be: >> >> a[1,3,5,6,7] or more generally a[list] (a[*list] seems unnecessarily >> complex and would be inconsistent with a[x..y] that is allowed). >> >> Is there a good reason this shouldn't be allowed? It would certainly >> simplify and shorten much of my code. > > It conflicts with the current implementation > > [1, 2, 3, 4, 5][1, 3] # => [2, 3, 4] > > On a tangent, if you find yourself doing a lot > of #values_at, you may want to consider possibly > changing your datastructure. > >> -j > >