From: Robert Dober Date: 2006-11-20T23:45:12+09:00 Subject: Cannot override #== with mixin, was help with patch to ruby-core ------=_Part_40302_10633818.1164033909837 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi all I have sent a little patch, defining HalfOrder, to ruby-core in order to get some help with a problem I have found. Maybe this was not the best procedure. So I'll try here again :( basically the patch defines a module HalfOrder which defines ">", ">=", "<" and "==" depending on "<=", well almost because a potential #== in the Mixer class, as in Set cannot be overwritten. I think this is a shame. Here goes some code expressed in ruby instead of C module HalfOrder ### Mixer has to define #<= ... def == other # in case of performance problems you might want to define == yourself self <= other && other <= self end ... end class Set include HalfOrder end Set.new == Set.new # works while it should raise a NoMethodError for a missing #<= well *should* as in I would like. Any ideas? ( Maybe the HalfOrder module should complain or warn when mixed into a Class already containing a #==; guess I do not know how to do that in C, yet) Cheers Robert -- The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. - George Bernard Shaw ------=_Part_40302_10633818.1164033909837--