4 The Design of FSet

The purpose of this chapter is to explain the major design decisions that went into FSet. It’s probably of greatest interest to experienced Common Lisp programmers who want to use the library, and to other language/library designers.

My design desiderata for FSet were, in roughly decreasing order of importance:

Don’t be daunted by the term “set-theoretic”. All I mean by it is that FSet collections are nestable: you can have sets of sets, maps keyed by seqs (FSet’s sequences) or even sets of seqs, etc. etc., with no additional effort on your part. While such types aren’t often needed in application programming, they do show up sometimes in compiler work.

The latter two properties drove the choice of data structures; see FSet Data Structures. The first three more concern the API. In particular, the first two are somewhat in conflict, as I’ll now explain.