[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

should `add-to-ordered-list' be able to use tests other than `eq'?

From: Drew Adams
Subject: should `add-to-ordered-list' be able to use tests other than `eq'?
Date: Sat, 23 Jul 2011 11:42:31 -0700

`add-to-list' uses `equal'.  Why does `add-to-ordered-list' use `eq'?

And if this `eq' behavior will be kept, then the NEWS (NEWS.22) is incomplete
(misleading) regarding the introduction of this function.  It says:

 *** New function `add-to-ordered-list' is like `add-to-list' but
 associates a numeric ordering of each element added to the list.

"Like" is pretty vague here.  It is not "like" `add-to-list' in the way it tests
membership etc., unless you consider `eq' to be "like" `equal'.

This is the (3-message) thread that discussed adding this function:

Should `equal' be used instead of `eq'?  Of if `eq' is the best default, should
the function accept an optional TEST arg?

For symbols (the originally proposed use case) there is no difference, but for
arbitrary Lisp objects there can be a big difference between `eq' and `equal'.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]