anchor.diff:           (defclass ,name-pstream (,name ,super-pstream)
              ,(mapcar #'desugar-slot (remove-if-not #'state-slot-p slots))
              (:documentation ,(format nil "pstream class for ~a." name)))
  -         (defun ,name ,(function-lambda-list slots)
  -           ,documentation
  -           ,pre-init
  -           (set-parents
  -            (make-instance ',name
  -                           ,@(mapcan (lambda (i) (list (alexandria:make-keyword (car i)) (car i)))
  -                                     (remove-if #'state-slot-p slots)))))
  +         ,(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
  
positive.code:   "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)
    ((key :reader pdef-key)
     (current-pstream :state t)
     (loop-p :initform t :accessor loop-p))
    "pdef names a pattern PATTERN by 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))
  
negative.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.
  
  CREATION-FUNCTION 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))
  