From: Arlen Cuss Date: 2008-03-26T21:15:21+09:00 Subject: Re: TOPLEVEL_OBJECT ------=_Part_24034_28337025.1206533726776 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, On Wed, Mar 26, 2008 at 10:41 PM, Trans wrote: > I also would like to ask why Ruby calls this object "main", but does > not use it in any other way. > > Found it! static VALUE main_to_s(VALUE obj) { return rb_str_new2("main"); } I jest, of course. :) We also see it actually declared/defined this way: void Init_top_self() { rb_vm_t *vm = GET_VM(); vm->top_self = rb_obj_alloc(rb_cObject); rb_define_singleton_method(rb_vm_top_self(), "to_s", main_to_s, 0); } I guess, it needs to be called something - or *should* be called something, just to distinguish it! So here's a way. Cheers, Arlen ------=_Part_24034_28337025.1206533726776--