From: Simon Strandgaard Date: 2004-05-01T09:50:02+09:00 Subject: Re: File.expand_path(__FILE__) "Ara.T.Howard" wrote: > On Sat, 1 May 2004, Simon Strandgaard wrote: [snip] > > I don't know if all this rethinking __FILE__/$0 makes sense.. > > i think it makes perfect sense to have > > __FILE__ => absolute path of script file > __PROGRAM__ => absolute path of called program > __RUBY__ => absolute path of ruby interp running called program > __DIR__ => absolute directory of file (can use for relative requires) > > it's always easy get a relative path from an absolute one, but not the other > way! This was what I wanted to express, though I could not write it in such a striking sentence :-) I don't know what is right nor wrong... Maybe make __FILE__ a class with a one useful method, #standalone? So that instead of 'if $0 == __FILE__' you can type 'if __FILE__.standalone?' Maybe make a System class, containing a $0 replacement? What does other languages do ? -- Simon Strandgaard