From: Christoph Rippel Date: 2001-01-23T02:09:16+09:00 Subject: [ruby-talk:9724] Re: 101 Misconceptions About Dynamic Languages > -----Original Message----- > From: nosuzuki@e-mail.ne.jp [mailto:nosuzuki@e-mail.ne.jp]On Behalf Of > Jean Michel ... > The functionality you want is to describe a mathematical structure, > such as a ring; the basic idea is that, as soon as certain operations > and fields are defined, you can define certain other ones. A template in Actually I did not want to define a field (not that this really matters ..) > C++ expresses perfectly this, but also a mixin in Ruby. The only thing > missing in Ruby here is the ability to overload on argument types; this > was circumvented by a hack around 'coerce'. Otherwise Ruby is fully > equivalent in expressiveness to C++. I disagree with you. If I mixin I destroy the original nature of the Class - oh well I can always mixin into a copy of my class. I also have to mixin the constants (which is only thing I am really interested in anyway) as a separate Module (via accessor_reader) and I have to remove the useless methods and I am probably stuck with the OO equivalent of a tangling pointer - i.e. an illogical inheritance hierarchy (well in this particular case ZZmod < Numeric I could probably live with it). No thanks templates or generics are a much cleaner solution. My point was not that is impossible to generically program in ruby but it basically discouraged by the current language design|sugar and I cannot truly escape the inheritance straight jacket OO-languages typically impose on me. Ruby is nice language it just not perfect either - I am fine with rubys untyped function but happen to dislike the IMO lagging support for generic programming. Christoph ...