On Thu, Aug 11, 2005 at 08:25:23PM -0700, Mark A. Biggar wrote:
: Mark A. Biggar wrote:
: >Small issue, what comparison operator do you use to determine 
: >duplicates?  For example (possibly pathological case):
: >
: >(undef but true) (+) (undef but false)
: 
: Actually, I'm going to make a stab at answering this myself.  The 
: obvious answer is that you use the magic operator ~~ by default just 
: like for a case statement.  But there does need to be some way to change 
: that when necessary.
We talked about that some in Portland.  We figured ~~ was probably
too dwimmy to serve that purpose, and that what we really needed was
the same comparison that will have to be used for hashes that are
allowed to contain objects, but also want to store values as values.
Essentially immutable values want to compare as values but mutable
objects by reference as individual entities.  At the moment we're
calling that operator "eqv", short for both "equivalent" and "equal
value".

It does need to be possible to change that, but since sets are
immutable values, we need only provide an alternate comparison to
the constructor, and the set itself needn't remember it.  On the
other hand, hashes behaving like mutable sets need to remember their
comparison operator if it is not the default.

Larry

Reply via email to