From: kurt@... Date: 2020-06-22T16:27:23+00:00 Subject: [ruby-core:98912] [Ruby master Bug#16976] Documentation bug in Proc Issue #16976 has been reported by kwerle (Kurt Werle). ---------------------------------------- Bug #16976: Documentation bug in Proc https://bugs.ruby-lang.org/issues/16976 * Author: kwerle (Kurt Werle) * Status: Open * Priority: Normal * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN ---------------------------------------- https://ruby-doc.org/core-2.7.0/Proc.html About 1/3 of the way through the docs, it states: Lambda semantics is typically preserved during the proc lifetime, including &-deconstruction to a block of code: ``` ruby p = proc {|x, y| x } l = lambda {|x, y| x } [[1, 2], [3, 4]].map(&p) #=> [1, 2] [[1, 2], [3, 4]].map(&l) # ArgumentError: wrong number of arguments (given 1, expected 2) ``` The 3rd line of code should be: ``` ruby [[1, 2], [3, 4]].map(&p) #=> [1, 3] ``` -- https://bugs.ruby-lang.org/ Unsubscribe: