From 3df59b04c2563b0a822033ed1b96d46cae98f824 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 24 Jan 2005 06:45:50 +0000 Subject: * document updates - [ruby-core:04296], [ruby-core:04301], [ruby-core:04302], [ruby-core:04307] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 3f0dec822..8351a6b28 100644 --- a/eval.c +++ b/eval.c @@ -8264,15 +8264,14 @@ static VALUE method_arity _((VALUE)); * call-seq: * prc.arity -> fixnum * - * Returns the number of arguments required by the block. If the block + * Returns the number of arguments that would not be ignored. If the block * is declared to take no arguments, returns 0. If the block is known * 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 proc with no argument declarations - * returns -1, as it can accept (and ignore) an arbitrary number of - * parameters. + * arguments. A proc with no argument declarations + * is the same a block declaring || as its arguments. * - * Proc.new {}.arity #=> -1 + * Proc.new {}.arity #=> 0 * Proc.new {||}.arity #=> 0 * Proc.new {|a|}.arity #=> 1 * Proc.new {|a,b|}.arity #=> 2 -- cgit