From: Charles Oliver Nutter Date: 2009-02-26T09:27:27+09:00 Subject: [ruby-core:22524] Re: YASNP (Yet Another Selector Namespace Proposal) Yehuda Katz wrote: > ...would namespace modules be searched before/after the object's > singleton class? > > singletons would win. In my prototype, they would win as well, but only because it expects the target object's *immediate* class to match one of the namespace mappings. So if there were a singleton, it would not match. But in general...I'm not sure. I feel like SNs are hooking the call, not the type; the narrowing to a specific type is just narrowing the hook. So in that case, it would still use the namespace if the singleton class had String somewhere in its ancestors. > ...would super in a singleton method search any namespace modules > (if the singleton > class was searched before namespace modules)? > > since it is lexically scoped, it would depend on where the singleton > method was defined. super is a little tricky. I'd like to say that the call it makes is a secondary call, but it's really not. Of course, since it's already a keyword, it's much easier to make super do "the right thing" than send or eval, but of course what does super mean if the method you're in or the method you're supering to doesn't actually exist in the class hierarchy? - Charlie