From: Robert Klemme Date: 2008-07-29T16:15:57+09:00 Subject: Re: problems with throw/catch (newbie) 2008/7/28 Thomas Luedeke : > What is annoying to me is that even Fortran 95 has the capability (using > "EXIT [construct] name") to get out of deeply nested loops. Why does > Ruby force you to use catch/throw (which intuitively seems like > exception handling to me). My example above used catch/throw for a > single loop, but the reason I asked is that I anticipate having to break > out of more deeply nested loops. Interestingly I cannot remember having to break from a nested loop. It must be a very rare situation in my programming. I can think of a number of reasons why that is: a) my programming style, namely to keep methods short and refactor b) the types of problems I build solutions for Not sure what it is in fact but I tend to believe that often this breaking from nested loop can easily be done via a "return" or having appropriate loop conditions. For example, this is an idiom I often use in other languages and it also works well for arbitrarily nested loops: def look_for x @items.each do |it| return it if x == it end nil end Maybe this helps. Kind regards robert -- use.inject do |as, often| as.you_can - without end