mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Proc#lambda? documented.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
80e38ad66b
commit
e615f0ec42
1 changed files with 24 additions and 0 deletions
24
proc.c
24
proc.c
|
@ -107,6 +107,30 @@ proc_clone(VALUE self)
|
|||
return procval;
|
||||
}
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
* prc.lambda? => true or false
|
||||
*
|
||||
* Returns true for a Proc object which argument check is rigid.
|
||||
* Such procs are typically generated by lambda.
|
||||
*
|
||||
* lambda {}.lambda? => true
|
||||
*
|
||||
* proc {}.lambda? => false
|
||||
* Proc.new {}.lambda? => false
|
||||
*
|
||||
* def m() end
|
||||
* method(:m).to_proc.lambda? => true
|
||||
*
|
||||
* def n(&b) b.lambda? end
|
||||
* n {} => false
|
||||
* n(&lambda {}) => true
|
||||
* n(&method(:m)) => true
|
||||
* n(&proc {}) => false
|
||||
* n(&Proc.new {}) => false
|
||||
*
|
||||
*/
|
||||
|
||||
static VALUE
|
||||
proc_lambda_p(VALUE procval)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue