On 10/16/07, David Flanagan <david / davidflanagan.com> wrote:


> I suggest that Range.first be removed, allowing Range objects to use the
> more general (and more correct) Enumerable.first method.  The existing
> behavior is retained in Range.begin, of course.

FWIW

-1 on this one.

> If that is too radical a change, I suggest that Range.first be extended
> to accept an integer argument.  And in that case, it should delegate to
> Enumerable.first. That is, even if (1..0).first continues to return 1,
> (1..0).first(1) should correctly return [].

+1/2 on this one, I guess.  Note that this won't work for all ranges,
for example:

(1.5..10.7).first(2)

Since float ranges aren't enumerable.


-- 
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/