From: Trans Date: 2007-02-22T02:43:14+09:00 Subject: Re: More flexible inheritance On Feb 19, 3:04 am, Yukihiro Matsumoto wrote: > What is the benefit of by this change? The benifits are more robust means of extension b/c 1) mixins can be used for extensions 2) mixins are much more flexible and elegant than open/alias/ redefine 3) no longer need to fuss with alias names or method binding 4) we would no longer require alias (which is a keyword) 5) lends itself to future possiblities such as uninclude 6) promotes better design and way of thinking whereby a class is a collection of "bahaviors" (sub your prefered term) > Besides that this change would make remove_method impossible. remove_method would be possible. by default it could effect the "lowest" module. and if need be, of course, one can select the particular mixin to effect. > I vaguely think of similar idea with combination of class box, so that > we can control side-effect from open classes, i.e. > > namespace foo # fake syntax > > # re-opening class that effective only in this namespace > class String > def a; "a"; end > end > > "foo".a # "a" method available here > > But I am still not confident of the benefit and effect of this > behavior. another topic worth consideration, but selector namespaces are a different animal I think --well, unless we can dynamically activate and deactive the mixin modules depedning on the namespace we're in, then namespaces could be based on these. Hmm...that's a cool idea, but I suspect it would require a major overhaul in how Ruby works under the hood. T.