[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Enumerable#inject is surprising me...

Nathaniel Talbott

10/7/2003 1:17:00 AM

nobu.nokada@softhome.net [mailto:nobu.nokada@softhome.net] wrote:

> > ['a'].inject(''){break 'b'} # => 'b'
>
> But this doesn't work as Nathaniel expected. It returns last
> iteration value, "".

I just tried this on both 1.8.0 and the latest CVS, and it appears to have
been introduced post-1.8.0. I didn't want anyone to panic when they couldn't
reproduce the problem :-)


Nathaniel

<:((><