From: "Simon Kröger" Date: 2006-10-09T21:09:58+09:00 Subject: Re: Removing Duplicate Objects from Object List Daniel N wrote: > If instead of declaring your @rules as an array, you declare it as a set > you > will get no duplicates for free (I think) yes but you will loose order (if that is important) > However, you need to incorporate the <=> operator in your Rule class to > tell ruby how your objects relate to each other. > ie are they <, >, or = That won't do the trick for uniq as uniq is using a hash internally do find duplicates. You have to define #hash and #eql? for this to work. (or was it #hash and #== ?) cheers Simon