From: Robert Klemme Date: 2009-08-29T18:20:07+09:00 Subject: Re: How to call this method On 28.08.2009 19:43, Bertram Scharpf wrote: > Hi, > > Am Samstag, 29. Aug 2009, 01:55:26 +0900 schrieb Robert Klemme: >> 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 > > No, it exits just one level: > > loop { puts "x" ; loop { puts "y" ; raise StopIteration } } Well, we're both right: it won't exit multiple *loop* levels but it will exit multiple *stack frames*, i.e. method and block calls (not containing loops of course). That's what I had in mind. Your point demonstrates though that catch throw might be superior because you explicitly declare the point of return. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/