From: Hugh Sasse Date: 2005-09-14T02:45:21+09:00 Subject: Re: Sets, uniqueness not unique. On Wed, 14 Sep 2005, David A. Black wrote: > Hi -- > > On Wed, 14 Sep 2005, Hugh Sasse wrote: > >> >> Sets *can't* hold duplicates, and include depends on eql? for Sets. > > Are you sure about that latter point? In set.rb: Yes I was, but it turns out that it was with the certainty that comes before falling flat on one's face. I remembered seeing it in the ri docs, and sure enough, it isn't there! [What was that fidonet .sig? "Open mouth, insert foot, echo internationally"? :-)] > > def include?(o) > @hash.include?(o) > end > > and in hash.c: > > if (st_lookup(RHASH(hash)->tbl, key, 0)) { > return Qtrue; > ... } > > I haven't followed the trail beyond that... but I think any two > student objects will count as different hash keys, even if they have > similar string data. Which would explain a lot. Thank you. Ara's hash function should fix this for me. > > > David > Thank you, Hugh