summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-15 01:52:45 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-15 01:52:45 +0000
commit7320e53be18278a2121bbfc1f7911cd5b2fd411d (patch)
tree722457c429876ed03d5e5393038986785d3c8fd8
parent9d4144af0942821bd6fbb752d734e8e26b91792b (diff)
* eval.c (Init_Proc): make proc as an alias to Proc.new.
[ruby-dev:24848] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--eval.c13
2 files changed, 14 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 0261ffb6db..a3776a8e85 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Nov 15 08:58:55 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * eval.c (Init_Proc): make proc as an alias to Proc.new.
+ [ruby-dev:24848]
+
Mon Nov 15 00:46:03 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_yield_0): lambda{}.call(1) should raise exception.
diff --git a/eval.c b/eval.c
index 2f58a216dd..cf886db648 100644
--- a/eval.c
+++ b/eval.c
@@ -8060,6 +8060,13 @@ proc_s_new(argc, argv, klass)
return block;
}
+/*
+ * call-seq:
+ * proc { |...| block } => a_proc
+ *
+ * Equivalent to <code>Proc.new</code>.
+ */
+
VALUE
rb_block_proc()
{
@@ -8075,7 +8082,6 @@ rb_f_lambda()
/*
* call-seq:
- * proc { |...| block } => a_proc
* lambda { |...| block } => a_proc
*
* Equivalent to <code>Proc.new</code>, except the resulting Proc objects
@@ -8231,8 +8237,7 @@ proc_call(proc, args)
* to take exactly n arguments, returns n. If the block has optional
* arguments, return -n-1, where n is the number of mandatory
* arguments. A <code>proc</code> with no argument declarations
- * returns -1, as it can accept (and ignore) an arbitrary number of
- * parameters.
+ * is handled like a block declaring <code>||</code> as its arguments.
*
* Proc.new {}.arity #=> 0
* Proc.new {||}.arity #=> 0
@@ -9294,7 +9299,7 @@ Init_Proc()
rb_define_method(rb_cProc, "to_proc", proc_to_self, 0);
rb_define_method(rb_cProc, "binding", proc_binding, 0);
- rb_define_global_function("proc", proc_lambda, 0);
+ rb_define_global_function("proc", rb_block_proc, 0);
rb_define_global_function("lambda", proc_lambda, 0);
rb_cMethod = rb_define_class("Method", rb_cObject);