From: eregontp@... Date: 2019-12-25T11:04:38+00:00 Subject: [ruby-core:96463] [Ruby master Feature#15973] Let Kernel#lambda always return a lambda Issue #15973 has been updated by Eregon (Benoit Daloze). ko1 (Koichi Sasada) wrote: > This is one idea: how about to prohibit `lambda(&...)` method call? (block literal is always prohibited) I think you mean non-literal block (`&`) becomes prohibited. > 3.0: deprecation warning and show 3.1 will raise exception for `lambda(&...)` > 3.1: raise exception for `lambda(&...)` > > same as `proc`. And whether it's `lambda(&...)` or `lambda { }` is detected by the lambda method itself (like for the warning)? That sounds good to me. ---------------------------------------- Feature #15973: Let Kernel#lambda always return a lambda https://bugs.ruby-lang.org/issues/15973#change-83391 * Author: alanwu (Alan Wu) * Status: Assigned * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) * Target version: 2.8 ---------------------------------------- When Kernel#lambda receives a Proc that is not a lambda, it returns it without modification. l propose to change `Kernel#lambda` so it always returns a lambda. Calling a method called lambda and having it do nothing in effect is not very intuitive. https://github.com/ruby/ruby/pull/2262 Judging from marcandre's investigation here: https://bugs.ruby-lang.org/issues/15620#note-1, changing the behavior should not cause much breakage, if any. This also happens to fix [Bug #15620] -- https://bugs.ruby-lang.org/ Unsubscribe: