From: mirian@... (Mirian Crzig Lennox) Date: 2001-05-28T22:29:26+09:00 Subject: [ruby-talk:15867] Re: is it possible to dynamically coerce objects types in Ruby? In article , Mathieu Bouchard wrote: >Three months ago I have written: > >module ArithInterface > def +(other); raise NotImplementedError; end > def -@; raise NotImplementedError; end >end > >module ArithMixin > include ArithInterface > def -(other) > self + - other > end >end > >and then I stopped there. ;-) Perhaps I will work on this, as an exercise to learn Ruby. It seems to me that when designing code for Ruby, it is always best to write something as a module rather than a class if possible, because a module is more flexible. Is this correct as a general rule of principle? --Mirian