From: Tanaka Akira Date: 2009-08-25T16:37:24+09:00 Subject: [ruby-core:25117] Re: Proposal: Simpler block format In article <245fb4700908231725i3fa65567xe82bcb5ca1b8dc90@mail.gmail.com>, Yehuda Katz writes: > There's no conceptual reason for programmers to differentiate between Proc > objects and the block passed to methods, except that the latter provides > some extra syntax to make the common use-case pretty. Trying to explain the > difference to new Rubyists strikes me as something we'd be better off never > having to do. Proc objects and blocks are different with "break". def m1 yield p :m1 end m1 { break } # break terminates m1 def m2(pr) pr.call p :m2 end m2(proc { break }) # break terminates proc in 1.8. LocalJumpError in 1.9 "break" needs to know the method call to terminate. Blocks knows but Proc objects doesn't. -- Tanaka Akira