From: Gary Wright Date: 2009-02-26T11:16:04+09:00 Subject: [ruby-core:22527] Re: YASNP (Yet Another Selector Namespace Proposal) On Feb 25, 2009, at 8:45 PM, Jim Weirich wrote: > On Feb 25, 2009, at 6:45 PM, Yehuda Katz wrote: >>> ...would super in a method defined in a namespace module search any >>> 'nested' namespaces? >> >> remember that namespaces are lexical. Once you exit the lexical >> scope, super >> reverts to its normal meaning. > > > My take on this is that selector namespaces are for preventing > accidental name collisions. The methods have no relationship to > each other and invoking a super in a method defined in a namespace > should not search search any other namespaces in scope at the > original call site. However, it probably *should* honor (i.e. > search) any namespaces in scope at the site of the super call. In Ruby's normal method invocation process, the runtime searches a sequence of modules/classes looking for a matching named method. Once found and executed, a call to 'super' in that method continues the search process from the point the method was found. In my understanding of the namespace proposal, the same overall algorithm applies except that the exact sequence of modules/classes is modified according to the modules 'inserted' via the 'using' keyword. If namespaces can be 'nested' so that multiple namespace modules are in the lookup sequence then shouldn't 'super' behave as normal and just resume the lookup process including any unsearched namespaces? Gary Wright