From: George Ogata Date: 2005-03-15T22:56:40+09:00 Subject: Re: Problem with rb_block_given_p() calling context? "Berger, Daniel" writes: > Why am I getting the nil? It looks like it's evaluating the call to > rb_block_given_p() on the Foo constructor, i.e. in foo_init, even though > I'm not explicitly passing it there. Calling a C function like `rb_class_new_instance' doesn't equate to a method call. The latter involves pushing on the ruby stack, the former doesn't. Same thing would happen if you called rb_ary_each in a similar situation -- the block would be "propagated" when you may not want it to be. Using `rb_funcall' to call Foo#new will work; I don't know if there's a better way.