summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/proc.c b/proc.c
index 943a49a96a..fdd148ebe9 100644
--- a/proc.c
+++ b/proc.c
@@ -465,6 +465,14 @@ rb_block_proc(void)
return proc_new(rb_cProc, FALSE);
}
+/*
+ * call-seq:
+ * lambda { |...| block } -> a_proc
+ *
+ * Equivalent to <code>Proc.new</code>, except the resulting Proc objects
+ * check the number of parameters passed when called.
+ */
+
VALUE
rb_block_lambda(void)
{
@@ -478,20 +486,6 @@ rb_f_lambda(void)
return rb_block_lambda();
}
-/*
- * call-seq:
- * lambda { |...| block } -> a_proc
- *
- * Equivalent to <code>Proc.new</code>, except the resulting Proc objects
- * check the number of parameters passed when called.
- */
-
-static VALUE
-proc_lambda(void)
-{
- return rb_block_lambda();
-}
-
/* Document-method: ===
*
* call-seq:
@@ -1798,13 +1792,13 @@ method_inspect(VALUE method)
static VALUE
mproc(VALUE method)
{
- return rb_funcall(Qnil, rb_intern("proc"), 0);
+ return rb_funcall2(rb_mRubyVMFrozenCore, idProc, 0, 0);
}
static VALUE
mlambda(VALUE method)
{
- return rb_funcall(Qnil, rb_intern("lambda"), 0);
+ return rb_funcall(rb_mRubyVMFrozenCore, idLambda, 0, 0);
}
static VALUE
@@ -2151,7 +2145,7 @@ Init_Proc(void)
/* utility functions */
rb_define_global_function("proc", rb_block_proc, 0);
- rb_define_global_function("lambda", proc_lambda, 0);
+ rb_define_global_function("lambda", rb_block_lambda, 0);
/* Method */
rb_cMethod = rb_define_class("Method", rb_cObject);