From: Robert Dober Date: 2009-08-29T02:09:52+09:00 Subject: Re: How to call this method On Fri, Aug 28, 2009 at 6:55 PM, Robert Klemme wrote: > On 28.08.2009 17:22, Bertram Scharpf wrote: >  > Am Freitag, 28. Aug 2009, 22:17:21 +0900 schrieb Robert Klemme: >>> >>> 2009/8/28 Robert Dober : >>>> >>>> http://pastie.org/597659 >>> >>> I didn't know StopIteration yet.  That's nice. >> >> I didn't know it either.  Is there anything that `break' cannot >> do better? > > Multilevel exit like you can also do with catch throw (see Find.find). Yep, by using "raise StopIteration" I make my intent a little bit clearer and it is less fragile in case I am getting embedded into other blox. But that is not the case here, I agree. I think it might also having been built for Enumerator#next loop do ... an_enum.next # might raise StopIteration ... end HTH R.