From: Robert Klemme Date: 2007-12-29T19:04:59+09:00 Subject: Re: Enumerable Integer? Nah. Integer#times Enumerator! On 28.12.2007 19:30, Trans wrote: > > On Dec 28, 12:01 pm, "Robert Klemme" > wrote: > >> I'd rather use 10.times.to_a instead of 10.to_a because the latter >> seems too unobvious to me. > > Understandable. But obvious isn't always the most important factor. A > straight #to_a is vastly more efficient. Good point. I'd like to point out that the overhead completely depends on the number where #to_a is invoked on. For small numbers the overhead is likely significant. But for large numbers, especially BigNums I'd say the overhead is negligible. But I guess, in reality this would be more often used with rather smallish numbers. So yes, this should be taken into account. Kind regards robert