Brian Candler
5/30/2007 7:28:00 AM
On Wed, May 30, 2007 at 07:50:05AM +0900, Logan Capaldo wrote:
> On 5/29/07, Robert Klemme <shortcutter@googlemail.com> wrote:
> >
> >
> >I was too fast (again). Even though the return value is used, I'd rather
> >do
> >
> >n.times { x = yield x }
> >
> >than using #inject which does more than needed in this case. :-)
> >
> >Now, did I look at all aspects...?
>
>
> Almost.
> you'd actually need
> n.times { x = yield x }
> x
Almost almost :-)
x = nil
n.times { x = yield x }
x