C Extension rb_block_call Weirdness

A

Asher Haig

I've already posted a description of my problem at Stackoverflow, but
realized it might be most appropriate to post here as well, so I will
summarize and then link.

I am having this problem consistently with 1.9.1-p378 and with 1.9.2rc1.

The short of it 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.

More detail and my code can be found here:
http://stackoverflow.com/questions/3217624/ruby-1-9-1-p378-c-extension-rb-block-call-weirdness

Any insight is appreciated, as I am at a point where it is difficult to
move on until this is worked out.

Asher
 
A

Asher Haig

Resolved:

The documentation should read: Calls a method on the recv, with the
method name specified by the symbol mid, with argc arguments in argv,
supplying func as the block. When func is called as the block, it will
receive the value from yield as the first argument, and data2 as the
second argument.

In other words, argc and argv are for the Ruby iteration method and not
for the "func" callback function, as the documentation suggests.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top