* README.EXT{,.ja} (rb_block_call): fixed about third/fourth

arguments to the block.  based on [ruby-core:31192] by Asher
  Haig.  [Bug #3558]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-07-11 12:20:28 +00:00
parent 9d64fe7ed2
commit c6820cc3be
3 changed files with 19 additions and 6 deletions

View File

@ -1,3 +1,9 @@
Sun Jul 11 21:20:27 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* README.EXT{,.ja} (rb_block_call): fixed about third/fourth
arguments to the block. based on [ruby-core:31192] by Asher
Haig. [Bug #3558]
Sun Jul 11 17:01:57 2010 Nobuyoshi Nakada <nobu@ruby-lang.org> Sun Jul 11 17:01:57 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* Makefile.in ({,dist-,real-}clean-ext): should also omit * Makefile.in ({,dist-,real-}clean-ext): should also omit

View File

@ -1167,9 +1167,13 @@ Sets the value of the instance variable.
VALUE (*func) (ANYARGS), VALUE data2) VALUE (*func) (ANYARGS), VALUE data2)
Calls a method on the recv, with the method name specified by the Calls a method on the recv, with the method name specified by the
symbol mid, supplying func as the block. func will receive the symbol mid, with argc arguments in argv, supplying func as the
value from yield as the first argument, data2 as the second, and block. When func is called as the block, it will receive the value
argc/argv as the third/fourth arguments. from yield as the first argument, and data2 as the second argument.
When yielded with multiple values (in C, rb_yield_values(),
rb_yield_values2() and rb_yield_splat()), data2 is packed as an Array,
whereas yielded values can be gotten via argc/argv of the third/fourth
arguments.
[OBSOLETE] VALUE rb_iterate(VALUE (*func1)(), void *arg1, VALUE (*func2)(), void *arg2) [OBSOLETE] VALUE rb_iterate(VALUE (*func1)(), void *arg1, VALUE (*func2)(), void *arg2)

View File

@ -1260,9 +1260,12 @@ VALUE rb_iv_set(VALUE obj, const char *name, VALUE val)
VALUE rb_block_call(VALUE obj, ID mid, int argc, VALUE * argv, VALUE rb_block_call(VALUE obj, ID mid, int argc, VALUE * argv,
VALUE (*func) (ANYARGS), VALUE data2) VALUE (*func) (ANYARGS), VALUE data2)
funcをブロックとして設定し, objをレシーバ, argcとargvを引 funcをブロックとして設定しobjをレシーバargcとargvを引数
数としてmidメソッドを呼び出す. funcは第一引数にyieldされた としてmidメソッドを呼び出すfuncは第一引数にyieldされた値
値, 第二引数にdata2, 第三, 第四引数にargcとargvを受け取る. 第二引数にdata2を受け取る複数の値がyieldされた場合(Cでは
rb_yield_values()とrb_yield_values2(), rb_yield_splat())
data2はArrayとしてパックされている第三, 第四引数のargcと
argvによってyieldされた値を取り出すことができる
[OBSOLETE] VALUE rb_iterate(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) [OBSOLETE] VALUE rb_iterate(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2)