Subject: Re: .times loop returns the number?
From: Roger Pack <rogerpack2005 gmail.com>
Date: Sun, 13 Jan 2008 06:07:40 +0900
References: 287152287205
In-reply-to: 287205
That should be in the standard lib for coolness and ruby-ish-ness :)
> class Numeric
> def of &block
> Array.new(to_i).map &block
> end
> end
>
> list = 42.of{ those }
>
> a @ http://codeforpeople.com/
--
Posted via http://www.ruby-forum.com/.