diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-11-15 01:52:45 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-11-15 01:52:45 +0000 |
commit | 7320e53be18278a2121bbfc1f7911cd5b2fd411d (patch) | |
tree | 722457c429876ed03d5e5393038986785d3c8fd8 /eval.c | |
parent | 9d4144af0942821bd6fbb752d734e8e26b91792b (diff) | |
download | ruby-7320e53be18278a2121bbfc1f7911cd5b2fd411d.tar.gz |
* 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
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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); |