6.6.1 Replay Sets

Data type: replay-set

The abstract class for FSet functional replay sets. Subclass of set.

Function: replay-set? x

Returns true iff x is an FSet functional replay set.

Data type: ch-replay-set

Functional replay sets implemented as pairs of a CHAMP set and a seq. Subclass of replay-set. These print as:

##{= e0 e1 ... }[compare-fn]

That is, there’s an = just inside the opening brace; otherwise they look like ch-sets. As always, the comparison function is printed only if it is not compare.

Function: ch-replay-set? x

Returns true iff x is an FSet functional CHAMP replay set.

Data type: transient-replay-set

The abstract class for FSet transient replay sets. Subclass of transient-set.

Function: transient-replay-set? x

Returns true iff x is an FSet transient replay set.

Function: empty-replay-set
Function: empty-ch-replay-set &key compare-fn-name

Constructor function. Returns an empty ch-replay-set. By default, its internal set will be organized by compare. To use a custom organization, supply the comparison function name (a symbol) as compare-fn-name; a hash function must have been defined for it using define-hash-function. (A custom organization will not affect the set’s ordering for iteration or printing; the only reason you would need one is if you had a user-defined data type for which you had not defined methods on compare and hash-value.)

Macro: replay-set &rest subforms
Macro: ch-replay-set &rest subforms
Macro: ch-custom-replay-set compare-fn-name &rest subforms

Constructor macro. Constructs a ch-replay-set according to the supplied argument subforms. Each argument subform can be an expression, whose value will be an element of the result set; or a list of the form ($ expression), in which case the expression must evaluate to a set (possibly a replay set), all of whose elements become elements of the result set. Elements are added in left-to-right order.

To use a custom organization, use ch-custom-replay-set. compare-fn-name must be a symbol naming the desired comparison function; a hash function must have been defined for it using define-hash-function.