From: Tilman Sauerbeck Date: 2006-08-29T03:56:01+09:00 Subject: Re: instance_eval, yield, C extensions --AhhlLboLdkugWU4S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Daniel Berger [2006-08-29 01:41]: Hi Daniel, I never worked with blocks in a C extension like you do, but I noticed a general problem in your code: > static VALUE foo_block(VALUE self){ > return rb_funcall(cFoo, rb_intern("new"), 0, rb_yield(self)); ^ You're passing one argument (the result of rb_yield()), yet you tell ruby to expect zero arguments. So make that 0 a 1. > static VALUE kernel_foo(VALUE self){ > VALUE v_proc =3D 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 --=20 A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? --AhhlLboLdkugWU4S Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQFE8zw727uLisrW2w8RAvv1AJ9lIBU0nJ650Q0gDQ/fMaR5IARh9ACffAPi kiCJInG7E+POtui2cfLT62U= =CNuL -----END PGP SIGNATURE----- --AhhlLboLdkugWU4S--