From: philip.bacon@... (Philip Bacon) Date: 2002-10-02T09:01:12+09:00 Subject: How do I invoke a block procedure from within a C extension? I am writing a C extension and wish to call a block from within one of my extension's methods. Ruby calling code cExtensionInstance.readtoken( 0, 10 ) { puts "hello world" } In the C function providing the readtoken method, I can have code like: VALUE blockProc; if ( rb_block_given_p() ) { blockProc = rb_f_lambda(); // how do I now call the block pointed to by blockProc? } My question is, what Ruby function do I use from within my C method function to call blockProc? Should I be calling rb_yield() or is there a simpler function to call? Many thanks, Phil