From: XrXr@... Date: 2019-12-30T22:55:20+00:00 Subject: [ruby-core:96602] [Ruby master Bug#16406] `(lambda_proc << normal_proc).lambda?` should return false Issue #16406 has been updated by alanwu (Alan Wu). Should be addressed by https://git.ruby-lang.org/ruby.git/commit/?id=99c7b0b7ea789643bef60085ab59e4b62011ef8b ---------------------------------------- Bug #16406: `(lambda_proc << normal_proc).lambda?` should return false https://bugs.ruby-lang.org/issues/16406#change-83569 * Author: alanwu (Alan Wu) * Status: Assigned * Priority: Normal * Assignee: alanwu (Alan Wu) * Target version: 2.8 * ruby -v: ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux] * Backport: 2.5: DONTNEED, 2.6: REQUIRED, 2.7: REQUIRED ---------------------------------------- Consider: ```ruby plus = proc { |a, b| a + b } mult_two = ->(x) { x * 2 } composed = mult_two << plus p [composed. lambda?, composed.call([1, 2])] ``` I think this ought to print `[false, 6]` instead of `[true, 6]`, as the call `composed.call([1, 2])` is clearly not using lambda semantics. Since `composed = f << g` calls `g` first, I think it makes sense to report `#lambda?` base on whether `g` has lambda semantics. I have a pull request at https://github.com/ruby/ruby/pull/2729 to make this change. -- https://bugs.ruby-lang.org/ Unsubscribe: