That, in turn, calls rb_define_module_function for Kernel, which
establishes the method as (a) a singleton method of Kernel itself, and
(b) a private instance method of Kernel.
The private instance methods then trickle down. You can see them not
only with Object but with other classes too:
> How do the Kernel.singleton_methods get to be
> Object.private_instance_methods?
Are they? I do not think so, maybe you could rephrase your question, I
am probably missing something.
Cheers
Robert
--
[...] as simple as possible, but no simpler.
-- Attributed to Albert Einstein
The question was not a good one. I now understand that the Kernel singleton methods are copies of private instance methods due to a call to module_function on them. Kernel's private instance versions of the methods get mixed in with Object as well as its public instance methods. I had not noticed that Kernel had private instance variables of the same name as its singleton methods.
Ron
···
On 8/4/07, ronald braswell <rpbraswell@hotmail.com> wrote:
>From: "Robert Dober" <robert.dober@gmail.com>
>Reply-To: ruby-talk@ruby-lang.org
>To: ruby-talk@ruby-lang.org (ruby-talk ML)
>Subject: Re: Object.private_instance_methods <--- Kernel.singleton_methods
>Date: Sat, 4 Aug 2007 20:30:10 +0900
>
> > How do the Kernel.singleton_methods get to be
> > Object.private_instance_methods?
>Are they? I do not think so, maybe you could rephrase your question, I
>am probably missing something.
>
>Cheers
>Robert
>
>
>--
>[...] as simple as possible, but no simpler.
>-- Attributed to Albert Einstein
>
The question was not a good one. I now understand that the Kernel singleton
methods are copies of private instance methods due to a call to
module_function on them. Kernel's private instance versions of the methods
get mixed in with Object as well as its public instance methods. I had not
noticed that Kernel had private instance variables of the same name as its
singleton methods.
ah you meant the results, of course, I am the worst guesser of the world
R.
···
On 8/5/07, ronald braswell <rpbraswell@hotmail.com> wrote:
>On 8/4/07, ronald braswell <rpbraswell@hotmail.com> wrote: