From: Christopher Dicely Date: 2009-10-14T13:51:26+09:00 Subject: Re: no Enumerator#[] ? On Tue, Oct 13, 2009 at 2:49 PM, Roger Pack wrote: > Currently > >>> "ab\r\nc".lines[0] > NoMethodError: undefined method `[]' for # >        from (irb):1 >        from C:/installs/ruby191p243p2/bin/irb:12:in `
' > > Doesn't it seem reasonable for this to exist? Enumerators may not be rewindable, so [], which would presumably provide random access to the values returned by the Enumerator may not be all that reasonable. On the other hand, any Enumerator for which rewind is usable also could support [], though any general implementation using rewind and each would be fairly inefficient.