From: John Lam Date: 2006-04-15T03:28:37+09:00 Subject: Re: Calling instance_eval on a block in C ------=_Part_37719_31513754.1145039314289 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I think you're right. I've tried all sorts of combinations before posting this plea for help :) Now I have to turn this method that I've been writing all morning inside-ou= t since I can't make this happen ... yuck. Thanks for looking around! -John http://www.iunknown.com Hey John, > > I'm not positive, but I don't think it is possible, because of the > block. Blocks come in through manipulated ruby_frames, even if they > look like they are passed in via shells. Clues being: > > static VALUE > rb_f_block_given_p() > { > if (ruby_frame->prev && ruby_frame->prev->iter =3D=3D ITER_CUR && > ruby_block) > return Qtrue; > return Qfalse; > } > > and the first hunk of specific_eval reading: > > if (rb_block_given_p()) { > if (argc > 0) { > rb_raise(rb_eArgError, "wrong number of arguments (%d > for 0)", argc\ > ); > } > return yield_under(klass, self); > } > > ------=_Part_37719_31513754.1145039314289--