Arlen Cuss
3/26/2008 12:15:00 PM
[Note: parts of this message were removed to make it a legal post.]
Hi,
On Wed, Mar 26, 2008 at 10:41 PM, Trans <transfire@gmail.com> 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