From: kentda@... Date: 2001-10-26T00:34:29+09:00 Subject: [ruby-talk:23308] Re: why the @ s ? On Fri, 26 Oct 2001, ts wrote: > You have always a class in ruby, for example when you write (at the > toplevel) > > def tt() > end > > you have defined a method for the class Object I thought it only was defined in the instance object, and not the Object class (which would affect ALL objects) verden:/a/homepvvd/d/kentda:(404)$ irb --version irb 0.6.1(99/09/16) verden:/a/homepvvd/d/kentda:(405)$ irb irb(main):001:0> def foobar; puts "FOOBAR"; end nil irb(main):002:0> Object.methods.each{|m| if m=="foobar" then puts m} irb(main):003:1> But thats Ruby 1.6.2, so I could be wrong... > @var, at the toplevel, is an instance variable for an object of Object. Agreed. Thanks for setting this straight. I forgot that Kernel is a module :-P -- <[ Kent Dahl ]>================<[ http://www.stud.ntnu.no/~kentda/ ]> )____(stud.techn.;ind.�k.data)||(softwareDeveloper.at(Trustix))_( /"Opinions expressed are mine and not those of my Employer, "\ ( "the University, my girlfriend, stray cats, banana fruitflies, " ) \"nor the frontal lobe of my left cerebral hemisphere. "/