From: ara.t.howard@... Date: 2006-07-22T01:08:56+09:00 Subject: Re: opacity of magic enumerator (was: Re: Using .each with constructors) On Sat, 22 Jul 2006 transfire@gmail.com wrote: > > Jacob Fugal wrote: >> On 7/21/06, transfire@gmail.com wrote: >>> But why does #times return the receiver in the first place? That can't >>> possible be anywhere near as useful as the alternative.... Just return >>> the collection. >> >> The primary reason I can see is that Fixnum#times is frequently used >> with a fairly large valued receiver. Such as in benchmarking: >> >> 10000.times{ ... } >> >> Do you really want that to generate a 10000 element array? Probably >> not. I too can see (and desire) the utility of a returned collection, >> but we lose the beauty of Fixnum#times as a replacement for the purely >> incremental while loop. > > Ouch. Good point. I like enumerators! ;-) > i put in an RCR for Fixnum#of long ago a, b, c, d = 4.of{ Hash.new } i use is pesonally quite a bit. -a -- suffering increases your inner strength. also, the wishing for suffering makes the suffering disappear. - h.h. the 14th dali lama