On 10/20/06, Sam Roberts <sroberts / uniserve.com> wrote:
> On Sat, Oct 21, 2006 at 01:08:52AM +0900, dblack / wobblini.net wrote:
> > What I mean is, if I've got something like:
> >
> >   teacher.students
> >
> > I expect/want a collection/array of students.  I'm just giving the
> > simplest case, of course, but the main thing is that I'm just not sold
> > on the reallocation of this method-name semantics for enumerators
> > instead of arrays (or array-ish things).
>
> Me, either, especially when we already extend the #each_ methods to
> return Enumerators.

Actually, I think that the right thing to do is something like this.

   1) Keep the new idea of having each* methods returning Enumerators
if no block is given.
   2) Go back to having String mix in Enumerable and have the each
method yield the lines in the string as in 1.8 if a block is given and
return an Enumerator which will yield the lines in the string if not.
   3) add lines, chars, and bytes methods in String which return
something reasonably like an Array, probably actually an Array

IMHO, this seems to be a good mix of adding the new ideas (which I
like) while maximizing compatibility with 1.8..


-- 
Rick DeNatale

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