From: ts Date: 2002-11-22T00:44:27+09:00 Subject: Re: [FAQ] Interpreted vs compiled [FAQ] defining methods anywhere >>>>> "J" == Jim Freeze writes: J> class Fred J> def fred; puts "1"; end J> fred J> end J> is different than J> def fred; puts "1"; end J> fred J> because self=main and not a class? You have partially found :-) At toplevel, self is an instance of Object J> the top level is a special case. No? Try this class Object def fred; puts "1"; end p self, self.class fred end Object is a special class in the ruby hierarchy Guy Decoux