From: Trans Date: 2008-12-05T02:51:22+09:00 Subject: Re: Enumerable#select used to return actual values On Dec 4, 12:31 pm, "Robert Dober" wrote: > On Thu, Dec 4, 2008 at 6:07 PM, Trans wrote: > >  [1,2,3].compact(1)  #=> [2,3] > > > Which is similar to #delete, except not in place. > > Indeed this is the behavior I had expected from delete and having a > delete! for what delete does now.> Though, using #=== > > instead of #== could be a very useful differentiation. > Hmm a negative grep > > >  [1,2,3,:x,:y,:z].compact(Symbol) #=> [1,2,3] > > Now I really would rather think of #reject although I had a different > idea for it which would answer your next question. Almost. There's an important distinction. #reject is an Enumerable method. #compact is an Array method. B/c of this, #compact can be and is implemented much more efficiently. Plus, it's not suitable for Enumerable methods to take arguments (though I heard a rumor this would change for 1.9, but I don't know if it did). T.