From: Harry Ohlsen Date: 2003-07-09T19:17:30+09:00 Subject: Re: Possible use for a continuation? [Generating all factors of a given number] Brian Candler wrote: > IIRC, 1.8 has "next " and "break " which return a value. That could be good! Thanks for the info. > In the above case, if 'isGenerator = false' terminates the loop, you could > just write > > exponent = phi / factor > (i ** exponent).to_i != 1 # continue condition Sorry, that was just a snippet of the overall code, to save people trying to understand all the details. The flag is there for other reasons. It just happens that it's value also tells me whether I can terminate the loop over the generated values. What I was getting at was that I didn't think it yelled out clearly that the last line in the block being just "isGenerator" was passing information back to the iterator, since this isn't something that I've often seen people do (although, that may just be a lack of data on my part). Harry O.