summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-10-08 09:48:09 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-10-08 09:48:09 +0000
commitcc2394638044c083269037aeb133e17b14a896ac (patch)
tree3d394c4b97883cca9169524115f9919c525320f2 /proc.c
parente1960cdba2d4c7f4105697402671ab252ee6a3e4 (diff)
merge revision(s) 33391:
* proc.c (proc_call): Update documentation to match argument handling of proc/Proc.new/lambda/->() git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@33431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/proc.c b/proc.c
index ef383b5492..cb44b102a5 100644
--- a/proc.c
+++ b/proc.c
@@ -518,10 +518,10 @@ proc_lambda(void)
* to an array). Note that prc.() invokes prc.call() with the parameters
* given. It's a syntax sugar to hide "call".
*
- * For procs created using <code>Kernel.proc</code> an error is generated
- * if the wrong number of parameters are passed to a proc with multiple
- * parameters. For procs created using <code>Proc.new</code>, extra
- * parameters are silently discarded.
+ * For procs created using <code>lambda</code> or <code>->()</code> an error
+ * is generated if the wrong number of parameters are passed to a Proc with
+ * multiple parameters. For procs created using <code>Proc.new</code> or
+ * <code>Kernel.proc</code>, extra parameters are silently discarded.
*
* Returns the value of the last expression evaluated in the block. See
* also <code>Proc#yield</code>.
@@ -529,14 +529,15 @@ proc_lambda(void)
* a_proc = Proc.new {|a, *b| b.collect {|i| i*a }}
* a_proc.call(9, 1, 2, 3) #=> [9, 18, 27]
* a_proc[9, 1, 2, 3] #=> [9, 18, 27]
- * a_proc = Proc.new {|a,b| a}
+ * a_proc = lambda {|a,b| a}
* a_proc.call(1,2,3)
*
* <em>produces:</em>
*
- * prog.rb:5: wrong number of arguments (3 for 2) (ArgumentError)
- * from prog.rb:4:in `call'
- * from prog.rb:5
+ * prog.rb:4:in `block in <main>': wrong number of arguments (3 for 2) (ArgumentError)
+ * from prog.rb:5:in `call'
+ * from prog.rb:5:in `<main>'
+ *
*/
static VALUE