Project

General

Profile

Actions

Bug #12809

closed

passing a proc to Kernel#lambda does not create a lambda

Added by sylvain.joyeux (Sylvain Joyeux) over 7 years ago. Updated over 7 years ago.

Status:
Rejected
Target version:
-
ruby -v:
2.0.0-p643, 2.1.9, 2.2.5, 2.3.1p112, 2.4.0preview2
[ruby-core:77489]

Description

I would expect the following:

p = proc { |a| a * 2 }
l = lambda(&p)
puts l.lambda? # => true
l.call(1, 2) # => ArgumentError

But it does not, basically l there looks very much like a non-lambda proc (another test is that a return in p would cause l.call to raise LocalJumpError)

Actions

Also available in: Atom PDF

Like0
Like0Like0