From: cbare Date: 2008-05-23T14:30:09+09:00 Subject: Re: Why does returning from a block cause a LocalJumpError Thanks Eric, that does help. But, I'm still a little puzzled. Take this blob of Java: void myMethod() { int a = 1; for (int i=0; i<10; i++) { int b = 2; System.out.println(a + b + i); } } If I understand correctly, even though b is defined inside the loop, a and b are both stored in the same stack frame when this method is compiled (barring optimation). At least, that's the way we did it in compilers 101. The compiler prevents access to b outside the loop, but the 4 bytes for b remain allocated on the stack during the whole execution of the method. Anyway, the execution of myMethod causes the allocation and cleanup of one stack frame. Not two, and certainly not one plus one for each execution of the loop. So, my guess is that a code block maintains that behavior. I'm still wondering why using the return keyword is different than implying the return value of the block and what a "Local Jump" is. Maybe I'm perseverating on this point, but I'm curious about how Ruby works under the hood. Thanks again, -chris