It there a way to pass code block to method, written in C?
What I want is something like
require 'myext’
include Myext
Myclass.mymeth(56) do |x|
p x
end
···
myext.c
…
void Init_myext()
{
VALUE m = rb_define_module(“Myext”);
rb_define_module_function(m, “mymeth”, mymeth, 1); /* ? */
}
…
VALUE mymeth() /* ? */
How can I define mymeth and yield block inside of it?