Kristof Bastiaensen <kristof / vleeuwen.org> wrote: > > I think it will not work with this syntax. > What means the following: > mymethod [ a ] > call mymethod, and collect a for each iteration, or call mymethod > with an array? Same peoblem with hashes and blocks now, no? > >> I believe that in the case a collecting/non collecting dychotomy > >> should exist it should be something at the convention level, like ! > >> for dangerous methods > > to_enum.to_a works with the current syntax: > (2..10).to_enum(:step, 3).to_a > => [2, 5, 8] Maybe a to_enum! (or #map_enum, or #map_over or #gather ...) that works like to_enum but does the .to_a step at the end for you. (I really wish to_enum had been called simply enum, incidentally - I'm a big fan of brevity. Not just typing - as Paul Graham pointed out, to_enum takes longer to say to yourself when reading over code, and thus slows you down.) > > Add % to the list of acceptable method name suffixes? (I'd say we've > > pretty thoroughly colonised the keyboard by now - good free symbols are > > hard to find.) > > That's true. I think every common symbol is used. > Fortunately they are arranged so as not to make ugly combinations. > Imagine having to type $_->$*@ or something. > Adding new syntax in an elegant way is not so easy... Very true. And Ruby has an excellent track record in that respect. martin