From: Charles Oliver Nutter Date: 2010-03-27T16:41:24+09:00 Subject: [ruby-core:29063] Re: [Feature #1961] Kernel#__dir__ On Fri, Mar 26, 2010 at 8:27 PM, Caleb Clausen wrote: > Yes, you are right. I tend to blur the distinction between subclassing > and extending objects at runtime in my own thinking. But whichever it > is, I'd rather not see a new type in ruby's semantics just to support > this feature. A new keyword seems so much more straightforward. A new keyword is less backward-compatible than adding methods to a string instance (or a string subclass). 1.8 could simply make __FILE__'s string additionally def dir; File.dirname(self); end and it would be compatible Of course, this is mostly academic for me...I'm just bikeshedding. __DIR__ would be fine with me too, or a per-file hash so we don't have to add future keywords (similar to __SOURCE_LINES) - Charlie