From: Wesley J Landaker Date: 2003-06-09T06:25:59+09:00 Subject: passing a block from C to Ruby -- revisited. ;) Hi folks, I'm trying to figure out how to call a ruby method from C while passing in a block. I read the ruby-talk [27774] thread from way back; it was sort of useful, but it wasn't clear when I read that how it applies to what I want to do: I have no problem getting and using a block passed into a C extension FROM ruby; going the other way seems a little more arcane--rb_iterate doesn't seem to do what I want, but maybe somebody can convince me otherwise. ;) Basically, I have: VALUE obj = ... some ruby object ...; VALUE proc = ... some ruby proc object ...; ID method = ... some ruby method id ...; Now, I just want to do the equivelent of: obj.method(&proc) Something like this imaginary function: rb_funcall2_with_block(obj, method, 0, 0, proc); -- Wesley J. Landaker - wjl@icecavern.net OpenPGP FP: C99E DF40 54F6 B625 FD48 B509 A3DE 8D79 541F F830