From: Arlen Cuss Date: 2008-02-28T22:19:42+09:00 Subject: Re: proc.new and return ------=_Part_15725_12478318.1204204779568 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Fri, Feb 29, 2008 at 12:15 AM, S2 wrote: > with your post and that of Jari i now understand: > > irb(main):001:0> [2, 4, 6].map {|q| return q * 2} > LocalJumpError: unexpected return > from (irb):1 > from (irb):1:in `map' > from (irb):1 > > > as expected. but if i put it inside a method > > irb(main):002:0> def hello > irb(main):003:1> [2, 4, 6].map {|q| return q * 2} > irb(main):004:1> end > => nil > irb(main):005:0> hello > => 4 > Excellent. :) Glad we could help. [I speak too on Jari's behalf here, it seems. I'm sure he's glad too. :)] Arlen ------=_Part_15725_12478318.1204204779568--