anchor.diff:              (let ((slot (qtype-stack-item-slot <type>)))
                 (case slot
                   (bool  (lambda (val si) (setf (si bool) (if val 1 0))))
  -                (class (if (typep obj 'qobject)
  -                           (let ((<from> (qobject-class obj)))
  +                (class (if qobject-class
  +                           (let ((<from> qobject-class))
                                (multiple-value-bind (castfn <to>)
                                    (resolve-cast <from> (qtype-class <type>))
                                  (lambda (val si)
  
positive.code: (defun marshal (value type stack-item cont)
    (funcall (marshaller value type) value stack-item cont))
  
  (defun marshaller (obj <type>)
    (let* ((set-thunk
            (macrolet
                ((si (slot)
  
negative.code:                                    (if (typep val 'cffi:foreign-pointer)
                                         val
                                         (qobject-pointer val))))))
                  (enum (cond ((subtypep obj-type 'integer)
                               (lambda (val si) (setf (si enum) val)))
                              ((subtypep obj-type 'enum)
                               (lambda (val si) (setf (si enum) (primitive-value val))))
                              (t (error "type mismatch: ~s for type slot ~s" obj-type slot))))
                  (int (cond ((subtypep obj-type 'integer)
                              (lambda (val si) (setf (si int) val)))
                             ((subtypep obj-type 'enum)
                              (lambda (val si) (setf (si int) (primitive-value val))))
                             (t (error "type mismatch: ~s for type slot ~s" obj-type slot))))
                  (uint (cond ((subtypep obj-type 'integer)
                               (lambda (val si) (setf (si uint) val)))
                              ((subtypep obj-type 'enum)
                               (lambda (val si) (setf (si uint) (primitive-value val))))
                              (t (error "type mismatch: ~s for type slot ~s" obj-type slot))))
                  (float (lambda (val si) (setf (si float) (float val 1.0s0))))
                  (double (lambda (val si) (setf (si double) (float val 1.0d0))))
                  ;; that leaves:
  