1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

update Proc#lambda? doc.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2007-12-24 06:56:06 +00:00
parent 1c3c98821b
commit e5988f7404

8
proc.c
View file

@ -115,8 +115,11 @@ proc_clone(VALUE self)
* Such procs are typically generated by lambda. * Such procs are typically generated by lambda.
* *
* lambda {}.lambda? => true * lambda {}.lambda? => true
* lambda {|a,b| [a,b]}.call(1,2,3) => ArgumentError
* *
* proc {}.lambda? => false * proc {}.lambda? => false
* proc {|a,b| [a,b]}.call(1,2,3) => [1,2]
*
* Proc.new {}.lambda? => false * Proc.new {}.lambda? => false
* *
* def m() end * def m() end
@ -124,10 +127,11 @@ proc_clone(VALUE self)
* *
* def n(&b) b.lambda? end * def n(&b) b.lambda? end
* n {} => false * n {} => false
* n(&lambda {}) => true
* n(&method(:m)) => true
* n(&proc {}) => false * n(&proc {}) => false
* n(&Proc.new {}) => false * n(&Proc.new {}) => false
* n(&lambda {}) => true
* n(&method(:m)) => true
* n(&method(:m)).to_proc => true
* *
*/ */