From: Daniel Berger Date: 2007-10-16T01:49:05+09:00 Subject: Re: RubyTraits 0.1 On Oct 15, 9:38 am, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: RubyTraits 0.1" > on Tue, 16 Oct 2007 00:23:43 +0900, Trans writes: > > |I see. So you don't really like the fact that modules fit into the > |inheritance chain? That's interesting. > > Actually they both have their own good. I like them both. I dislike > to have them both in a language. Traits injection is clear and less > error prone (there's no possibility of conflicts), but sometimes > method overriding is _very_ useful, where aliasing is very poor way to > create method combination. > > If someone come to the idea to allow modules to have merits from both > mixins and traits at once (without demerit), I'd love to hear. I solved this "problem" over two years ago with fine grained mixins. Please see http://rubyforge.org/docman/view.php/735/309/README.html and look at the synopsis. Ideas (and code) in that library also came from Ara Howard and Mauricio Fernandez. I don't want up front object composition. To me that's like static typing, except for object composition. At worst, a warning should be issued if a double inclusion occurs. This is what the 'use' library does in verbose mode. Regards, Dan