From: Dominik Bathon Date: 2006-02-20T09:48:31+09:00 Subject: Re: Passing a proc as block to a method from a C extension On Mon, 20 Feb 2006 01:01:28 +0100, Yukihiro Matsumoto wrote: > HI, > > In message "Re: Passing a proc as block to a method from a C extension" > on Sun, 19 Feb 2006 03:56:52 +0900, "Dominik Bathon" > writes: > > |I am looking for a way to do the equivalent of the following ruby > function > |in a C extension: > | > |def foo(my_proc) > | bar(&my_proc) > |end > | > |(and it should also work if bar is instance_eval or module_eval) > > Currently there's no good way, since no one has complained loudly > before. Let me think about your request. Ok, thanks. That's what I thought. I would like to have a function like VALUE rb_iterate_proc(VALUE (*it_proc)(), VALUE data1, VALUE proc); that would work like block_pass(). Btw. could we also get a version of rb_iter_break that breaks with a value instead of just nil? Dominik