Daniel DeLorme
1/30/2008 1:06:00 AM
Marcel Molina Jr. wrote:
> On Jan 29, 2008, at 4:07 PM, "Martin DeMello" <martindemello@gmail.com>
>> So we can write, for instance
>>
>> ints = input.select Integer
>
> You can do that with grep.
>
> [1, :foo].grep Fixnum
> # => [1]
Oh wow, I never knew you could do that. That means we can also do:
>> [2,4,6,7].grep(1..5)
=> [2, 4]
But still, I think the point of the OP was that this idiom should also
be available for the other methods (reject, partition, any?, all? ...)
Daniel