anchor.diff:    (define-ucxr-accessors))
   
   (declaim (hash-table *ucons-root-table*))
  -(defvar *ucons-root-table* (make-hash-table :test #'eql))
  +(defvar *ucons-root-table* (make-hash-table :test #'eql)
  +  "The table of all uconses whose cdr is NIL.")
   
   (declaim (inline ucons))
   (defun ucons (car cdr)
  -  "Given a CAR that is either a number, a symbol, a character or a ucons
  -   and a CDR that is either NIL, or a ucons, return a UCONS that is EQ to
  -   all future and past invocation of this function with the same
  -   arguments."
  +  "Given a suitable CAR and CDR, return a UCONS that is EQ to all future
  +   and past invocation of this function with the same arguments."
     (declare (type (or null ucons) cdr)
  -           (type ucons-car car)
  +           (type ucar car)
              (values ucons))
     (flet ((hash-table-lookup (hash-table)
              (declare (hash-table hash-table))
              (or (gethash car hash-table)
                  (setf (gethash car hash-table)
  -                     (%ucons car cdr))))
  +                     (make-fresh-ucons car cdr))))
            (alist-lookup (alist)
              (declare (list alist))
              (or (cdr (assoc car alist))
  -               (let ((ucons (%ucons car cdr)))
  +               (let ((ucons (make-fresh-ucons car cdr)))
                    (prog1 ucons
                      (cond
                        ((> (length alist) 5)
  
positive.code:         do (setf ulist (ucons-cdr ulist))))
  
  (defun ulist-shallow-copy (ulist)
    (declare (ulist ulist))
    (loop while ulist
          collect (ucons-car ulist)
          do (setf ulist (ucons-cdr ulist))))
  
  (defun ulist-deep-copy (ulist)
    (declare (ulist ulist))
    (loop while ulist
          collect (let ((car (ucons-car ulist)))
  
negative.code: (in-package :petalisp)
  
  ;;; ucons - unique conses
  ;;;
  ;;; Some applications benefit a lot by reusing existing cons cells instead
  ;;; of actual consing. Usually this technique is called hash consing.
  ;;; Users of this technique are e.g. the optimizer of the computer algebra
  ;;; system Maxima and the theorem prover ACL2.
  ;;;
  ;;; This particular implementation is intended for use cases where
  ;;; performance is so critical, that even a single hash table access is too
  ;;; expensive. To achieve such near-optimal speed, this implementation does
  ;;; not actually provide conses, but uconses. A ucons has not only a car
  ;;; and a cdr, but also a table of past users. Furthermore, the cdr of each
  ;;; ucons is restricted and may only contain other uconses or NIL. As a
  ;;; consequence, all lists of uconses are proper lists and data structures
  ;;; of uconses are always trees. This setup has several advantages:
  ;;;
  ;;; - the check whether a certain ucons already exists is a single lookup
  ;;;   of its car in the table of its cdr
  ;;;
  ;;; - the immutability of the car and cdr of a ucons is enforced by the
  ;;;   defstruct definition of ucar
  ;;;
  ;;; - a compiler has reliable type information of the slots of a ucons
  ;;;
  ;;; Unfortunately there is also a painful downside of this
  ;;; approach. Traditional cons cells are a fundamental Lisp data type and
  ;;; well supported throughout the standard library. Uconses lack this
  ;;; integration, e.g. it is not possible to treat them as a sequence. As a
  ;;; result, many utility functions have to be reimplemented specifically
  ;;; for uconses.
  ;;;
  ;;; Finally, it must be noted that uconses are --- except if one eventually
  ;;; clears the *UCONS-ROOT-TABLE* --- a permanent memory leak. But if you
  ;;; are willing to accept these trade-offs, uconses offer some unique
  ;;; benefits:
  ;;;
  ;;; - their usage is little more expensive than a call to CONS. If you
  ;;;   include GC time, they can even be much faster.
  ;;;
  ;;; - given enough potential for structural sharing, uconses can decrease
  ;;;   the memory consumption of an application by orders of
  ;;;   magnitude. Often, this results in vastly improved cache utilization.
  ;;;
  ;;; - checks for structural similarity can be done in constant time. Two
  ;;;   ucons-expressions are equal if and only if their head uconses are EQ.
  
  
  (deftype ucar ()
    "The type of all elements that may appear as the UCAR of a UCONS."
    '(or fixnum symbol function character ucons))
  
  (deftype ulist ()
    "A list made of UCONSes, or NIL."
    '(or ucons null))
  
  (defstruct (ucons
              (:constructor make-fresh-ucons (car cdr))
              (:copier nil) ; this is the whole point, isn't it?
              (:predicate uconsp))
    (cdr   nil :type ulist :read-only t)
    (car   nil :type ucar  :read-only t)
    ;; TABLE tracks all UCONSes whose UCDR is this cons
    (table nil :type (or list hash-table) :read-only nil))
  
  ;;; provide classical slot readers like UCAR and UCADDR
  (macrolet
      ((define-ucxr-accessors ()
         (let (ucxr-forms)
  