From: William James Date: 2006-02-02T06:50:32+09:00 Subject: Re: Numeric#of ara.t.howard@noaa.gov wrote: > i threw this out before. thought i'd try again: > > harp:~ > irb > irb(main):001:0> class Numeric; def of(&b) Array::new(self).map(&b) end; end > => nil > > irb(main):002:0> 42.of{ String::new } > => ["", "", "", "", "", "", "", "", "", "", . . . class Fixnum def of (0...self).map{ yield } end end p 3.of { "" } ===> ["", "", ""] -- future, n. That period of time in which our affairs prosper, our friends are true, and our happiness is assured. --- Ambrose Bierce