anchor.diff:    "Set PDEF-KEY's KEY in its plist to PATTERN."
     (pdef-ref pdef-key (plist-set (pdef-ref pdef-key) (alexandria:make-keyword key) pattern)))
   
  -(defpattern pdef (pattern)
  +(defpattern pdef (pattern) ;; FIX: should this call set-parents on its PATTERN?
     ((key :reader pdef-key)
      (current-pstream :state t)
      (loop-p :initform t :accessor loop-p))
  -  "pdef names a pattern PATTERN by KEY.")
  +  "pdef defines a named pattern, with KEY being the name of the pattern and PATTERN the pattern itself. Named patterns are stored in a global dictionary by name and can be referred back to by calling `pdef' without supplying PATTERN. The global dictionary also keeps track of the pdef's pstream when `play' is called on it. Additionally, if a pdef is currently being played, and is redefined, the changes won't be audible until PATTERN ends (pdefs loop by default)."
  +  (defun pdef (key &optional (pattern nil pattern-supplied-p))
  +    (when (or (not (null pattern))
  +              pattern-supplied-p)
  +      (pdef-ref-set key :pattern pattern))
  +    (make-instance 'pdef
  +                   :key key)))
   
   (create-global-dictionary pdef)
  -
  -(defun pdef (key &optional (pattern nil pattern-supplied-p))
  -  "pdef names a pattern PATTERN by KEY."
  -  (when (or (not (null pattern))
  -            pattern-supplied-p)
  -    (pdef-ref-set key :pattern pattern))
  -  (make-instance 'pdef
  -                 :key key))
   
   (defmethod pdef-pattern ((object pdef))
     (pdef-ref-get (pdef-key object) :pattern))
  
positive.code: 
  DOCUMENTATION is a docstring describing the pattern. We recommend providing at least one example, and a \"See also\" section to refer to similar pattern classes.
  
  PRE-INIT is an expression which will be inserted into the pattern creation function prior to initialization of the instance. Typically you'd use this for inserting `assert' statements, for example."
    (let ((slots (mapcar #'alexandria:ensure-list slots))
          (name-pstream (intern (concatenate 'string (symbol-name name) "-PSTREAM") 'cl-patterns))
          (super-pstream (if (eq 'pattern (car superclasses))
  
negative.code:          (defclass ,name-pstream (,name ,super-pstream)
             ,(mapcar #'desugar-slot (remove-if-not #'state-slot-p slots))
             (:documentation ,(format nil "pstream class for ~a." name)))
           ,(let* ((gen-func-p (or (null creation-function)
                                   (and (listp creation-function)
                                        (position (car creation-function) (list 'assert)))))
                   (pre-init (when gen-func-p
                               creation-function)))
              (if gen-func-p
                  (make-defun pre-init)
                  (add-doc-to-defun creation-function)))
           (export '(,name ,name-pstream))))))
  
  (defparameter *max-pattern-yield-length* 64
  