------art_23247_1675269.1204287013780
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Guy,

On Fri, Feb 29, 2008 at 10:53 PM, ts <decoux / moulon.inra.fr> wrote:

> No, not really. a function at toplevel is a private method of Object.

Aha! Actually, it's great to see you reply to this entry. I've seen you
comment in this list in the past on this topic (173746, 207801) which was
part of my attempt to understand it all.

  For example #inspect is defined in Kernel, and you can write
>
> vgs% ruby -e 'def inspect() puts "Object#inspect"; super end; p 12;
> 12.inspect'
> Object#inspect
> 12
> -e:1:in `<main>'Object#inspect
> : private method `inspect' called for 12:Fixnum (NoMethodError)
> vgs%

I see. If I try the way you do, I get the same result. If anything, this
tells me I should be careful about using irb to work this stuff out, as it
produces a different (!) result;
 >> def inspect(); puts "Object#inspect"; super end; p 12; 12.inspect
Object#inspect
12
Object#inspect
"12"
>>

Guy Decoux
>

Cheers! :)
Arlen

------art_23247_1675269.1204287013780--