From: Satish Talim Date: 2007-04-16T10:06:31+09:00 Subject: Re: Is main an object or a method? ------=_Part_30325_19838309.1176685589105 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Chad, I stand corrected. That was the impression I was carrying when I started learning Ruby (and coming from a long Java background). I realized my folly a long time back and corrected my statement here - http://sitekreator.com/satishtalim/first_program.html but forgot to correct the same at the url you mention. Thanks for pointing it out - it's now corrected. Satish On 4/16/07, Chad Perrin wrote: > > I was surprised, while reading Satish Talim's ruby tutorial, to discover > that main is actually a method -- at least, it is according to the Open > Classes section of the tutorial: > > http://rubylearning.com/satishtalim/ruby_open_classes.html > > To quote: > > Please note that self.class refers to Object and self refers to method > main. Therefore while running this program you are executing the main > method of object Object. > > Is that correct? I would have thought main was an instance of Object, > and thus was an object itself, not a method of class Object. Using > Object.methods within irb doesn't list a main method, so I'm skeptical. > > -- > CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ] > Brian K. Reid: "In computer science, we stand on each other's feet." > > ------=_Part_30325_19838309.1176685589105--