From: Mathieu Bouchard Date: 2002-01-24T00:10:54+09:00 Subject: Re: ruby 2.0; rubicon On Wed, 23 Jan 2002, Chr. Rippel wrote: > "Mathieu Bouchard" wrote in, > > I don't know. Not sure why Module.constants is useful anyway. > You can you use them to distinguish constants defined in different > scopes - so something like #constants_scoped might be more > descriptive oh, then that's: (Module.nesting[0] || ::Object).constants right? > If you really think about it, by making including transitive (and > anti-reflexive) you end up with a partial inclusion order, in other > words an oriented cycle free graph, introducing the same problems > and advantages of ordinary multiple inheritance That's not it. The languages known for their mixin inheritance are CommonLisp and Self, and they do it with an oriented cycle-free graph. They remove duplicates by themselves. In Ruby it's the same except that in addition to removing duplicates in a similar way, you can't add supermodules to supermodules in a meaningful way. In the real "multiple inheritance" now, you don't have those issues because you don't have a single chain of supers, which trades some kind of flexibility for some other kind of flexibility. ________________________________________________________________ Mathieu Bouchard http://hostname.2y.net/~matju