From: Sean O'Halpin Date: 2009-02-02T07:46:09+09:00 Subject: Re: Object#singleton_class in Ruby 1.9? On Sun, Feb 1, 2009 at 7:42 PM, David A. Black wrote: [snip] > But 'extend' already means something: add a module to the lookup path. Yes - to the special lookup path shared by subclasses qua instances and clones. > The module that gets added is a completely different object from the > singleton class, and you can extend an object with any number of > modules, anonymous or otherwise. Well, yes, that's understood :) > So there's no special identity > between the 'extend' operation and the singleton class. I'm not saying there's an identity - I'm saying that extend and the singleton class are closely related concepts. > There's a > relation, in the sense that obj.extend(M) is like class << obj; > include M; end, but I don't think there's any reason to name the > singleton class itself in honor of the fact that there's a method > called extend that operates on it, if you see what I mean. I do see what you mean. However, the relationship between #extend and the singleton class is much closer than you allow. The singleton class is the thing that's extended. There are no other methods that operate exclusively on the singleton class. In fact, the singleton class springs into existence to accommodate an extend if it's not already there. On reading Trans' post, I was struck that extension_class, i.e. the site of extensions, would be a good name to unify these concepts. But I'd be happy with any name. Regards, Sean