From: Eero Saynatkari Date: 2006-08-29T04:52:55+09:00 Subject: Re: instance_eval, yield, C extensions Daniel Berger wrote: > Tilman Sauerbeck wrote: >> ruby to expect zero arguments. So make that 0 a 1. >> >> >>> static VALUE kernel_foo(VALUE self){ >>> VALUE v_proc = rb_proc_new(foo_block, self); /* Also tried Qnil */ >>> return rb_funcall(rb_cObject, rb_intern("instance_eval"), 0, v_proc); >> >> Some problem here. >> >> HTH, >> Tilman > > Ok, fixing that I get "can't convert Proc into String (TypeError)". Right now that code is equivalent to obj.instance_eval block Where it should be obj.instance_eval &block obj.instance_eval {some_code} obj.instance_eval 'some_code' > Maybe I'm supposed to be using rb_block_proc, but I'm not entirely > certain how > it works. > > Thanks, > > Dan -- Posted via http://www.ruby-forum.com/.