Hongli Lai wrote:
> I think it should be __DIR__ for consistency. There are no other __ things in Ruby
> that are lowercase. I think whether __dir__ is a keyword or a function should be an
> implementation detail.

You should see solutions in the original post:
> (1) add a toplevel constant __DIR__
> pros: looks like __FILE__
> cons: adding new keyword
> 
> (2) add Kernel#__DIR__
> pros: no new keyword
> cons: it should have a lower-case name (like 1.9's __method__),
> because it is not a constant but a method.
> 
> (3) add Kernel#__dir__
> pros: no new keyword, and it is clearer than (4) that it has
> some associations with __FILE__.
> 
> (4) make __FILE__ to the default argument of File.dirname
> pros: no new keyword nor new method
> cons: it is not clear that 'File.dirname' is expanded to
> the path of directory of __FILE__.

And you can add cons to (3) add Kernel#__dir__
cons: lacking consistency for __FILE__

I think so too and I like (1).

-- 
NARUSE, Yui  <naruse / airemix.jp>