From: Thomas E Enebo Date: 2006-02-19T01:40:48+09:00 Subject: Odd break behavior? Run the code snippet below: class A def outer inner do break end end def inner while true yield end puts "Should never appear" end end ['something'].each do A.new.outer puts "1" end A.new.outer puts "2" Then comment out the something each block and rerun it. The first run will look like: 1 2 The second run will look like: Should never appear 2 For consistencies sake, I would have expected the first run to look like: 1 Should never appear 2 By virtue of previously calling outer in a block the second call to outer now has different behavior (even though to me they look totally unrelated). Can someone explain why this is? -Tom -- + http://www.tc.umn.edu/~enebo +---- mailto:enebo@acm.org ----+ | Thomas E Enebo, Protagonist | "Luck favors the prepared | | | mind." -Louis Pasteur |