From: Evan Phoenix Date: 2006-03-28T10:17:39+09:00 Subject: Re: PATCH: A subclassable Pathname Hm, well, thats because of the shortcut behavior in Pathname#+ which tests that the argument is absolute. I'll fix that and see if thats done other places and change them to create new instances from self.class. On 3/27/06, Tanaka Akira wrote: > In article <87fyl3x0wd.fsf@m17n.org>, > Tanaka Akira writes: > > > The class of an argument may be different from > > self.class.new. > > > > For example, if P inherits Pathname, > > Pathname.new("...") + P.new("...") returns an instance of > > Pathname. > > Oops. It was wrong. It may return an instance of P. > > % ./ruby -Ilib -rpathname -e ' > class P1 < Pathname; end > class P2 < Pathname; end > p P1.new("a") + P2.new("b") > p P1.new("a") + P2.new("/b") > ' > # > # > > I think it is inconsistent. > -- > Tanaka Akira > > -- When I do good, I feel good; when I do bad, I feel bad, and that is my religion. -- Abraham Lincoln (1809 - 1865)