On Thu, 21 Jun 2001 21:04:17 +0900, ts <decoux / moulon.inra.fr> wrote:

>   rb_alias(CLASS_OF(x), rb_intern("inspect_old"), rb_intern("inspect"));
>   rb_define_singleton_method(x, "inspect", myInspect, 0);

unfortunately this solution breaks encapsulation, too:
cluttering rb_cHash's globally visible namespace for
the sake of defining just one singleton method.

is there another way to obtain the the underlying
class method from within the singleton? 

my current workaround is to 'dup' the hash in the
singleton method, so i can apply the class method
on the duplicate. the possible performance lack
doesn't hurt in my case, since it appears in debug
code only, but i think there should be a general
solution.

ciao, andi