From: ts Date: 2003-04-18T01:33:46+09:00 Subject: Re: extension - redirect a block >>>>> "d" == daniel writes: d> But in the examples there is only ``__inspect_key__幹 - d> I don't know how to use this for my implementation... Well, you can look in bdb (common.c) and plruby but they are really badly written and perhaps only me can understand what they do :-) Basically, in rPAInit() you store the block in a thread local variable, something like rb_thread_local_aset(rb_thread_current(), rb_intern("__block__"), rb_f_lambda()); Then when the second function is called, you retrieve the block and call it, something like VALUE block, res; block = rb_thread_local_aref(rb_thread_current(), rb_intern("_block_")); res = rb_funcall(block, rb_intern("call"), 1, INT2FIX(12)); Guy Decoux