* error.c (ArgumentError): [DOC] update document following
  [Feature #9025]

* proc.c (proc_call, proc_curry): [DOC] ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-10-25 00:39:29 +00:00
Родитель b78b66a976
Коммит 94bdb010f6
2 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -1592,7 +1592,7 @@ syserr_eqq(VALUE self, VALUE exc)
*
* <em>raises the exception:</em>
*
* ArgumentError: wrong number of arguments (2 for 1)
* ArgumentError: wrong number of arguments (given 2, expected 1)
*
* Ex: passing an argument that is not acceptable:
*

10
proc.c
Просмотреть файл

@ -749,7 +749,7 @@ rb_block_clear_env_self(VALUE proc)
*
* <em>produces:</em>
*
* prog.rb:4:in `block in <main>': wrong number of arguments (3 for 2) (ArgumentError)
* prog.rb:4:in `block in <main>': wrong number of arguments (given 3, expected 2) (ArgumentError)
* from prog.rb:5:in `call'
* from prog.rb:5:in `<main>'
*
@ -2713,16 +2713,16 @@ curry(VALUE dummy, VALUE args, int argc, VALUE *argv, VALUE passed_proc)
*
* b = lambda {|x, y, z| (x||0) + (y||0) + (z||0) }
* p b.curry[1][2][3] #=> 6
* p b.curry[1, 2][3, 4] #=> wrong number of arguments (4 for 3)
* p b.curry(5) #=> wrong number of arguments (5 for 3)
* p b.curry(1) #=> wrong number of arguments (1 for 3)
* p b.curry[1, 2][3, 4] #=> wrong number of arguments (given 4, expected 3)
* p b.curry(5) #=> wrong number of arguments (given 5, expected 3)
* p b.curry(1) #=> wrong number of arguments (given 1, expected 3)
*
* b = lambda {|x, y, z, *w| (x||0) + (y||0) + (z||0) + w.inject(0, &:+) }
* p b.curry[1][2][3] #=> 6
* p b.curry[1, 2][3, 4] #=> 10
* p b.curry(5)[1][2][3][4][5] #=> 15
* p b.curry(5)[1, 2][3, 4][5] #=> 15
* p b.curry(1) #=> wrong number of arguments (1 for 3)
* p b.curry(1) #=> wrong number of arguments (given 1, expected 3)
*
* b = proc { :foo }
* p b.curry[] #=> :foo