anchor.diff:      ;; Check the csrf token
       (let ((session-token (get-form-session-csrf-token form)))
         (when (or (not session-token)
  -		(not (equalp session-token
  -			     (hunchentoot:post-parameter (form-csrf-field-name form)))))
  -	(error "Invalid CSRF token"))))
  +                (not (equalp session-token
  +                             (hunchentoot:post-parameter (form-csrf-field-name form)))))
  +        ;; The form is not valid. Throw an error, but reset its CSRF token for next time
  +        (set-form-session-csrf-token form)
  +        (error "Invalid CSRF token"))))
     (loop for field in (form-fields form)
  -       do (field-read-from-request (cdr field) form
  -				   (hunchentoot:post-parameters*))))
  +     do (field-read-from-request (cdr field) form
  +                                 (hunchentoot:post-parameters*))))
   
   (defgeneric field-read-from-request (field form parameters))
   
  
positive.code: 
  (defmacro defform (form-name args fields)
    `(setf (get ',form-name :form)
  	 (lambda ()
  	   (make-instance 'form
  			  :name ',form-name
  			  :fields (list ,@(loop for field in fields
  					     collect
  					       (destructuring-bind (field-name field-type &rest field-args) field
  						 `(cons ',field-name (make-form-field ,field-type :name ,(string field-name) ,@field-args)))))
  			  ,@args))))
  
  (defmacro defform-builder (form-name args &body body)
    (alexandria:with-unique-names (form)
      `(setf (get ',form-name :form)
  	   (lambda ,args
  	     (let ((,form (progn ,@body)))
  	       (setf (form-name ,form) ',form-name)
  	       ,form)))))
  
  (defun make-form (name fields &rest options)
    (apply #'make-instance
  	 'form
  	 :name name
  	 :fields (make-form-fields fields)
  	 options))
  
  (defun make-form-fields (fields)
    (loop for field in fields
       collect
         (destructuring-bind (field-name field-type &rest field-args) field
  	 (cons field-name (apply #'make-form-field field-type :name (string field-name) field-args)))))
  
  (defun get-form (name &rest args)
    (let ((form-builder (get name :form)))
  
negative.code: (defmethod set-form-session-csrf-token ((form form))
    (hunchentoot:start-session)
    (setf (hunchentoot:session-value (form-session-csrf-entry form))
          (make-csrf-token form)))
  
  (defun validate-form (&optional (form *form*))
    (setf (form-errors form)
          (loop for field in (form-fields form)
             appending
               (multiple-value-bind (valid-p errors)
                   (validate-form-field (cdr field))
                 (when (not valid-p)
                   (list (cons (cdr field) errors))))))
    (values (null (form-errors form))
            (form-errors form)))
  
  (defun render-form (&optional (form *form*) &rest args)
    (apply #'renderer-render-form *form-renderer* *form-theme* form args))
  