From: ts Date: 2001-05-13T01:18:07+09:00 Subject: [ruby-talk:15040] Re: calling .inspect on array/hash causes core dump >>>>> "A" == Andreas Riedl writes: A> but i have to embedd ruby in C so i'd like to do this: one possible solution is : pigeon% cat tt.c #include #include static VALUE tt(a) VALUE a; { return rb_funcall(a, rb_intern("inspect"), 0, 0); } int main() { VALUE vAry,vStr; ruby_init(); vAry = rb_ary_new3(2, INT2FIX(3), INT2FIX(5)); vStr = rb_funcall(vAry, rb_intern("to_s"), 0, 0); printf ("to_s=<%s>\n", STR2CSTR(vStr)); vStr = rb_iterate(tt, vAry, 0, 0); printf ("inspect=<%s>\n",STR2CSTR(vStr)); return 0; } pigeon% pigeon% tt to_s=<35> inspect=<[3, 5]> pigeon% Guy Decoux