From: sylvain.joyeux@...4x.org
Date: 2016-10-05T15:48:39+00:00
Subject: [ruby-core:77489] [Ruby trunk Bug#12809] passing a proc to Kernel#lambda does not create a lambda

Issue #12809 has been reported by Sylvain Joyeux.

----------------------------------------
Bug #12809: passing a proc to Kernel#lambda does not create a lambda
https://bugs.ruby-lang.org/issues/12809

* Author: Sylvain Joyeux
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: 2.0.0-p643, 2.1.9, 2.2.5, 2.3.1p112, 2.4.0preview2
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
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)

~~~
~~~



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>