[plt-scheme] Naming an equality operator

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Sat Feb 18 18:05:20 EST 2006

On Feb 17, 2006, at 7:18 PM, Carl Eastlund wrote:

> One personal coding project I have been working on is an extensible
> equality operator (think equal?, but you can override its behavior on
> certain types of values it will encounter along its traversal).
> Before I do anything rash like use it in distributed code, or
> distribute it as a planet package, I'd like to have a good name for
> the operator.  Currently our namespace is pretty cluttered with
> equality operators - each type has one, like string=? and bytes=?, and
> there are already three generic equalities (eq?, eqv?, and equal?).
> So what is a good name for a third?
>
> For now I've called it "equality", but that's not a great name.
> (equality A B) doesn't suggest the right thing, it's the wrong part of
> speech or something and it doesn't have a ? to suggest a predicate.
> What do people think about the names "same?", "equals?", or "equ?"
> [pause to distance one question mark from another] ?  Does anyone have
> a better name?

xequal? xoequal?

> As a separate note, I often find cases where I have equality
> predicates and ordering functions, and both can be called
> "comparisons", which leads to confusion.  Does the word "comparison"
> suggest one or the other?  Is there a better word or words to
> distinguish the two?

<-X and <=-X (for a real name X) are looking good. -- Matthias


>
> --
> Carl Eastlund
> "Cynical, but technically correct."
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme



Posted on the users mailing list.