Why do Ruby procs/blocks with splat arguments behave differently than methods and lambdas?
问题 Why do Ruby (2.0) procs/blocks with splat arguments behave differently than methods and lambdas? def foo (ids, *args) p ids end foo([1,2,3]) # => [1, 2, 3] bar = lambda do |ids, *args| p ids end bar.call([1,2,3]) # => [1, 2, 3] baz = proc do |ids, *args| p ids end baz.call([1,2,3]) # => 1 def qux (ids, *args) yield ids, *args end qux([1,2,3]) { |ids, *args| p ids } # => 1 Here's a confirmation of this behavior, but without explanation: http://makandracards.com/makandra/20641-careful-when