This package browser is in early development. Mind the rough edges.

cl-mw-equiv

Extensible object equivalence protocol for Common Lisp

Common Lisp comes with quite some functions to compare objects for equality, yet none is applicable in every situation and in general this is hard, as equality of objects depends on the semantics of operations on them. As consequence, users find themselves regularly in a situation where they have to roll their own specialized equality test.

This module provides one of many possible equivalence relations between standard Common Lisp objects. However, it can be extended for new objects through a simple CLOS protocol. The rules when two objects are considered equivalent distinguish between mutating and frozen objects. A frozen object is promised not to be mutated in the future in a way that operations on it can notice the difference.

We have chosen to compare mutating objects only for identity (pointer equality), to avoid various problems. Equivalence for frozen objects on the other hand is established by recursing on the objects' constituent parts and checking their equivalence. Hence, two objects are equivalent under the OBJECT= relation, if they are either identical, or if they are frozen and structurally equivalent, i.e. their constituents are point-wise equivalent.

Since many objects are potentially mutable, but are not necessarily mutated from a certain point in their life time on, it is possible to promise to the equivalence relation that they remain frozen for the rest of their life time, thus enabling coarser equivalence than the often too fine-grained pointer equality.

Installation

Install the latest version of cl-mw-equiv as follows:

guix install cl-mw-equiv

Or install a particular version:

guix install cl-mw-equiv@0.1.2-1.3ae8714

You can also install packages in augmented, pure or containerized environments for development or simply to try them out without polluting your user profile. See the guix shell documentation for more information.

Badge code

You can use the following badge to inform users of cl-mw-equiv about the latest version available in Guix.

Example HTML:

<a href='https://packages.guix.gnu.org/packages/cl-mw-equiv'><img src='https://packages.guix.gnu.org/packages/cl-mw-equiv/badges/latest-version.svg' alt='Version in GNU Guix'></a>

Example Markdown:

[![Version in GNU Guix](https://packages.guix.gnu.org/packages/cl-mw-equiv/badges/latest-version.svg)](https://packages.guix.gnu.org/packages/cl-mw-equiv)

Example Org:

[[https://packages.guix.gnu.org/packages/cl-mw-equiv][https://packages.guix.gnu.org/packages/cl-mw-equiv/badges/latest-version.svg]]