From: Jamis Buck Date: 2005-01-06T08:35:14+09:00 Subject: Re: Return from a block? On 08:17 Thu 06 Jan , Carlos wrote: > [Howard Lewis Ship , 2005-01-06 00.11 CET] > > Is there a way to return control from the block to the method? > > next > > Good luck. To elaborate a little more: a = proc { |i| next i+1 } p a.call(5) Hope that helps. I can understand why 'return' behaves like it does, but there are times I wish there was a more intuitive keyword for returning a value from a block. 'next' just feels wrong to me. :( - Jamis -- Jamis Buck jamis_buck@byu.edu http://www.jamisbuck.org/jamis ------------------------------ "I am Victor of Borge. You will be assimil-nine-ed."