From: Nobuyoshi Nakada Date: 2010-07-11T18:48:09+09:00 Subject: [ruby-core:31187] Re: [Bug #3558] Passing args with rb_block_call Hi, At Sun, 11 Jul 2010 17:44:51 +0900, Asher Haig wrote in [ruby-core:31186]: > The short of the problem is that when I call rb_block_call, the called block > function receives the yield value and data2 appropriately, but argc is > always set at 1 (no matter what I pass) while argv[ 0 ] and argv[ 2 ] == > yield value, and argv[ 1 ] == Qfalse. You must not access beyond the boundary. > So far as I can tell from looking at the internals (primarily > invoke_block_from_c and vm_yield_with_cfunc), no handling is > being done for the args that were passed to > rb_block_call. Instead, the specified function gets argc/argv > from rb_yield, which is always 1 and the value from rb_yield. Yes. It's the exactly intended behavior. > There are only three examples that I see in the Ruby source > that use rb_block_call while passing args: one in Enumerator, > and two in Range. The method signatures there provided me > additional confusion (VALUE i, void* args), as it does not > match the description of expected functions. Presumably it > still works since it ends with the void pointer, which is > being used for variable args. What do you want to do at all? -- Nobu Nakada