Published March 3, 2021 | Version v1
Proposal Open

Generic Equality and Comparison for Common Lisp

  • 1. DISCo, Università degli Studi di Milano-Bicocca

Description

Several Common Lisp functions rely on the :test keyword to pass a predicate to be used in their operations.
This is a satisfactory solution in most cases, yet, while writing algorithms and libraries it would be useful to
have "hooks" in the type and class system allowing for the definition of extensible equality and comparison
tests.


This proposal contains a minimal set of (generic) functions that can be recognized in several language
specifications, e.g., Java.


The specification is centered on two concepts: that of an equality test and that of a comparison generic
operator. The comparison operator returns different values depending on whether the its execution determines
the ordering relationship (or lack thereof) of two objects.


In addition to these two basic concepts, the specification provides notion of generic hash function too.
Of course, there are several "caveats" to be taken into consideration in the interplay between equality and
hashing.

Files

CDR-008_Generic_Equality.pdf

Files (301.3 kB)

Name Size Download all
md5:5be5cbcfa8245c6244e225b9ce9b56db
301.3 kB Preview Download