summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-23 15:36:00 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-23 15:36:00 +0000
commitc99093176119c10f3850796b65b0338101248409 (patch)
tree964ad6dabc1b73218615a51514b00bff2fd3f383
parente708616384761dc708068bc7ab18bcde84578e29 (diff)
downloadruby-c99093176119c10f3850796b65b0338101248409.tar.gz
ruby-c99093176119c10f3850796b65b0338101248409.tar.xz
ruby-c99093176119c10f3850796b65b0338101248409.zip
Proc#lambda? documented.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--proc.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/proc.c b/proc.c
index a3dcc0c97..a994c3157 100644
--- a/proc.c
+++ b/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)
{