Gerardo Santana Góíez Garrido wrote: > In a C extension I have a function that calls to rb_yield to invoke > the block that the final user will supply. > > I want to call that function from within that same C extension. The > problem is how to create and pass a block to this function, in C. > > Thanks in advance for any advice. > > I think rb_iterate() will do what you want. VALUE rb_iterate( VALUE (*method)(), VALUE args, VALUE (*block)(), VALUE arg2 ) Invokes method with argument args and block block. A yield from that method will invoke block with the argument given to yield and a second argument arg2. -- RMagick OS X Installer [http://rubyforge.org/projects/rmagick/] RMagick Hints & Tips [http://rubyforge.org/forum/forum.php?forum_id=1618] RMagick Installation FAQ [http://rmagick.rubyforge.org/install-faq.html]