From: Ilias Lazaridis Date: 2005-03-22T06:29:52+09:00 Subject: Re: [EVALUATION] - E03 - jamLang Evaluation Case Applied to Ruby Martin Ankerl wrote: >>> You can think of the whole file as "main". The code will be read from >>> top to bottom. > [...] > >> This means that ruby is _not_ strictly Object Oriented. > > Ruby is not strictly OO, but not for the reason you think. Here is a > nice explenation why: > http://www.rubycentral.com/book/classes.html#S3 impressive. >> And this means that I can drop the "if __FILE__ [...]" construct. > > __FILE__ is the name of the current source file. ok, here i guessed right (intuitive naming). > $0 is the name of the top-level ruby program being executed. here i thought that "$0" represents "NULL". $0 => main-file (or entry-file, or top-level file, or top-level program) > So this construct just checks if this the source file is the file that > is executed directly with e.g. 'ruby talker.rb', and only if this is the > case, the codeblock will be executed. Ok, now it's clear. > martinus .. -- http://lazaridis.com