On Oct 13, 6:03=A0pm, Patrick Okui <po... / psg.com> wrote:
> On Oct 14, 2009, at 12:49 AM, Roger Pack wrote:
>
> > Currently
>
> >>> "ab\r\nc".lines[0]
> > NoMethodError: undefined method `[]' for #<Enumerator:0x155f220>
> > =A0 =A0 =A0 =A0from (irb):1
> > =A0 =A0 =A0 =A0from C:/installs/ruby191p243p2/bin/irb:12:in `<main>'
>
> > Doesn't it seem reasonable for this to exist?
>
> Try "ab\r\nc".lines.to_a[0].

Perhaps it does. Why should it have to convert the whole enumerable to
an array, if it only needs to calculate 0..index? Of course, it might
be very inefficient to keep asking for lines that way,
nonetheless... ?