From: Martin Duerst Date: 2008-10-14T10:49:56+09:00 Subject: [ruby-core:19326] Re: [Feature #643] __DIR__ Just some alternatives for everybody. What about __DIR__DIR__DIR__ instead of __DIRDIRDIR__? Seems easier to count the levels. For those who want to type less, maybe we can choose __DIR_DIR_DIR__ as a compromize? Anyway, I think one problem with using File.dirname, in particular repeatedly, is that it's rather long. And the reason it's long is that it's not really object-oriented. So we should work towards something like __FILE__.dir.dir.dir, which is easier to read and much shorter. Regards, Martin. At 04:08 08/10/14, Ryan Davis wrote: > >On Oct 13, 2008, at 11:27 , Thomas Sawyer wrote: > >> __DIR__ >> >> This will improve readability, remove the need for extra variables >> to store this information, and at the very least, save us a good >> many keystrokes. > >yes. > >I frequently need to do: > > File.dirname(File.dirname(__FILE__)) > >so I'd like > > __DIRDIR__ > >can we also have > > __DIRDIRDIR__ > >while you're in there? > > #-#-# Martin J. Du"rst, Assoc. Professor, Aoyama Gakuin University #-#-# http://www.sw.it.aoyama.ac.jp mailto:duerst@it.aoyama.ac.jp