4 ms·
Refinements will be at the 2.0 release but I wouldn't call that feature "multiple inheritance".
by pabloh 14y ago
Refinements will be at the 2.0 release but I wouldn't call that feature "multiple inheritance".
- draegtun 14y agoNeither would I because refinements are something completely different to traits! Refinements proposed in Ruby 2.0 allows you to localise monkey-patching much like you can do in Perl with dynamic scoping (for e.g.: http://news.ycombinator.com/item?id=1603321 http://news.ycombinator.com/item?id=1603321 | http://news.ycombinator.com/item?id=3455507 http://news.ycombinator.com/item?id=3455507). For further info on Ruby refinements see here: http://timelessrepo.com/refinements-in-ruby http://timelessrepo.com/refinements-in-ruby Traits are an improvement to mixins. IIRC Matz gave a talk (RubyConf 2010?) where he describes the proposed traits implementation. Here's one set of slides (not Matz's talk) which also shows some traits examples - http://www.slideshare.net/fabiokung/ruby-20-to-infinity-and-beyond http://www.slideshare.net/fabiokung/ruby-20-to-infinity-and-...