From: Wayne Vucenic Date: 2001-10-22T05:00:35+09:00 Subject: [ruby-talk:22893] Possible RCR? - break for nested loops A month or two ago on this mailing list there was a discussion of the best way to break out of nested loops. I think a minor change to Ruby would allow an elegant way to do this. We could change "break" to optionally allow an integer argument n, so "break " would break out of n enclosing loops. (The Korn shell does this.) for i in 0..5 for j in 5..8 if i == j break 2 end end end if i == j print "match\n" else print "nomatch\n" end It seems to me this is a clear, concise solution, that directly expresses the programmer's intent, which in this case is to "break out of 2 loops". If we did this, for consistency we'd probably want to make the same change to redo, next, and retry. Wayne