From: ts Date: 2001-05-12T19:58:33+09:00 Subject: [ruby-talk:15034] Re: calling .inspect on array/hash causes core dump >>>>> "A" == Andreas Riedl writes: A> for debugging purposes i'd be fine to call the 'inspect' A> method for these objects. A> sort of A> rb_funcall(value,rb_intern("inspect"),0); A> works well for numbers,strings,classes, A> but fails for arrays & hashes. Can you give a complete example of failure ? pigeon% cat tt.c #include static VALUE tt_ins(self) VALUE self; { return rb_funcall(self, rb_intern("inspect"), 0, 0); } void Init_tt() { rb_define_method(rb_cObject, "ins", tt_ins, 0); } pigeon% pigeon% ruby -rtt -e 'p ({1 => 2}.ins)' "{1=>2}" pigeon% pigeon% ruby -rtt -e 'p ([1 , 2].ins)' "[1, 2]" pigeon% Guy Decoux