From: ts Date: 2005-05-10T00:50:08+09:00 Subject: Re: Problem with Math module in extension. >>>>> "E" == Ernest Ellingson writes: E> Thanks for the information. I still can't seem to get the syntax right E> for calling Math.sin from an extension. svg% cat aa.c #include static ID id_push, id_sin; static VALUE t_init(VALUE self) { VALUE arr; arr=rb_ary_new(); rb_iv_set(self, "@arr", arr); return self; } static VALUE t_add(VALUE self, VALUE obj) { VALUE arr; VALUE si; arr=rb_iv_get(self, "@arr"); si = rb_funcall(rb_mMath, id_sin, 1, obj); rb_funcall(arr, id_push,1,si); return arr; } VALUE cTest; void Init_aa() { cTest=rb_define_class("Junk", rb_cObject); rb_define_method(cTest, "initialize",t_init,0); rb_define_method(cTest, "add", t_add,1); id_push = rb_intern("push"); id_sin = rb_intern("sin"); } svg% Guy Decoux