On Tue, 25 May 2004, Hal Fulton wrote: > Gavin Kistner wrote: > > On May 25, 2004, at 5:08 AM, David Alan Black wrote: > > > >> A couple of ideas: > >> 1. Integer#collect # maybe too vague > >> 2. Integer#times! # ! as a warning that results are accumulating > > > > > > Don't method names ending in ! imply that the receiver is being modified. > > (Do any methods exist in the core/standard which are so named, but which > > do not modify the receiver?) > > There is at least exit! and I think one or two others. > > Matz has said that the ! signifies danger in general. > > > It would be foolish to think that > > 3.times! { ... } > > could modify the integer 3, but that's what the second suggestion says > > to me (despite being a nice attempt at an end-run around the performance > > problem of accumulating while only wanting to iterate). > > It's starting to become unreadable IMO. > > > Hal i must say that idea of a collecting block syntax is a nice one... this conversation has basically went the same way my own thought process went before submitting the RCR. 'of' might not be the _greatest_ name, but then again neither is 'map' (unless you have programmed perl). my point is this: 'of' is nice and short and mnemonic _enough_, at least as mnemonic as Array#map isn't it? after you'd seen a, b, c = 3.of { MyClass.new } or even first, second, third, fourth = 4.of {|which| MyClass.new which } once, maybe thrice, in some sources - wouldn't it be clear enough? -a -- =============================================================================== | EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov | PHONE :: 303.497.6469 | ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328 | URL :: http://www.ngdc.noaa.gov/stp/ | "640K ought to be enough for anybody." - Bill Gates, 1981 ===============================================================================