From: "rits (First Last)" Date: 2013-08-04T03:00:13+09:00 Subject: [ruby-core:56359] [ruby-trunk - Bug #8693] lambda invoked by yield acts as a proc with respect to return Issue #8693 has been updated by rits (First Last). nobu (Nobuyoshi Nakada) wrote: > Then it's a bug in that book. What exactly are you claiming is a bug in the book? The general rule about lambda semantics, that return in a lambda is supposed to return from the lambda? Are you suggesting the following is a bug? irb(main):007:0> def m1 l; l.() end; def m2; m1 ->{return 0}; 1 end; m2 => 1 Since matz is the author of both the language and the book, perhaps he can clarify where the bug is. In case he has not seen this thread, please ask him to weigh in. ---------------------------------------- Bug #8693: lambda invoked by yield acts as a proc with respect to return https://bugs.ruby-lang.org/issues/8693#change-40864 Author: rits (First Last) Status: Rejected Priority: Normal Assignee: Category: Target version: ruby -v: ruby 2.0.0p247 (2013-06-27) [x64-mingw32] Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN irb(main):004:0> def m1; yield end; def m2; m1 &->{return 0}; 1 end; m2 => 0 -- http://bugs.ruby-lang.org/