[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: Passing an Object Class from a method to a caller

Michael Granger

9/12/2003 2:52:00 AM

On Thursday, September 11, 2003, at 03:49 PM, dblack@superlink.net
wrote:

>> This happens because your break causes the value of the last evaluated
>> statement (i.e., the 'print') to be the result of the 'for' loop,
>> which is
>> what it breaks out of.
>
> I think break (pre-1.8.0 or without explicit value in 1.8.0) evaluates
> to nil:
>
> $ ruby -ve 'def x; for a in [1]; b=2; break; end; end; p x'
> ruby 1.6.8 (2002-12-24) [powerpc-darwin6.3]
> nil

I stand corrected.

--
Michael Granger <ged@FaerieMUD.org>
Rubymage, Believer, Architect
The FaerieMUD Consortium <http://www.FaerieMU...