Nobuyoshi Nakada wrote:
> Hi,
> 
> At Tue, 28 Aug 2007 07:21:29 +0900,
> Bertram Scharpf wrote in [ruby-core:12014]:
>> I guess there are still better ways to implement it because
>> now the following works:
>>
>>   irb(main):004:0> s.instance_eval "@signo = /.*/"
>>
>> Should I supply a more sophisticated patch?
> 
> Like this?
> 
> 
> Index: signal.c > =================================================================== > --- signal.c (revision 13258) > +++ signal.c (working copy) > @@ -265,4 +265,11 @@ esignal_init(argc, argv, self) > > static VALUE > +esignal_signo(self) > + VALUE self; > +{ > + return rb_iv_get(self, "signo"); > +} > + > +static VALUE > interrupt_init(argc, argv, self) > int argc; > @@ -1073,5 +1080,5 @@ Init_signal() > > rb_define_method(rb_eSignal, "initialize", esignal_init, -1); > - rb_attr(rb_eSignal, rb_intern("signo"), 1, 0, 0); > + rb_define_method(rb_eSignal, "signo", esignal_signo, 0); > rb_alias(rb_eSignal, rb_intern("signm"), rb_intern("message")); > rb_define_method(rb_eInterrupt, "initialize", interrupt_init, -1); >
> See this bug report: http://rubyforge.org/tracker/index.php?func=detail&aid=11795&group_id=426&atid=1698 In addition to Bertram's patch (which is the same as I reported), you'll need to patch eval.c. Regards, Dan