anchor.diff:  
   (defpackage #:cffi-sys
     (:use #:cl #:java)
  -  (:import-from #:alexandria #:hash-table-values #:length=)
  +  (:import-from #:alexandria #:hash-table-values #:length= #:format-symbol)
     (:export
      #:canonicalize-symbol-name-case
      #:foreign-pointer
  
positive.code: (defvar *callbacks* (make-hash-table))
  
  (defmacro convert-args-to-lisp-values (arg-names &rest body)
    (let ((gensym-args (loop :for name :in arg-names
                             :collecting (gensym (format nil "~A-~A-" '#:callback-arg name)))))
      `(lambda (,@gensym-args)
         (let ,(loop 
                  :for arg :in arg-names
                  :for gensym-arg :in gensym-args
                  :collecting `(,arg (if (typep ,gensym-arg 'java:java-object)
                                     (java:jobject-lisp-value ,gensym-arg) 
                                     ,gensym-arg)))
           ,body))))
  
  (defmacro %defcallback (name return-type arg-names arg-types body
                          &key convention)
    (declare (ignore convention)) ;; I'm always up for ignoring convention, but this is probably wrong.
    `(setf (gethash ',name *callbacks*)
           (jinterface-implementation 
            (ensure-callback-interface ',return-type ',arg-types)
            "callback"
            `,(convert-args-to-lisp-values ,arg-names ,@body))))
  ;;          (lambda (,@arg-names) ,body))))
  
  (jvm::define-class-name +callback-object+ "com.sun.jna.Callback")
  (defconstant 
      +dynamic-callback-package+
    "org/armedbear/jna/dynamic/callbacks"
    "The slash-delimited Java package in which we create classes dynamically to specify callback interfaces.")
  
negative.code: 
  (defun qualified-callback-interface-classname (returns args)
    (format nil "~A.~A"
            (substitute #\. #\/ +dynamic-callback-package+)
            (callback-interface-classname returns args)))
  
  (defun callback-interface-classname (returns args)
    (flet ((stringify (thing)
             (typecase thing
               (jvm::jvm-class-name
                (substitute #\_ #\/
                           (jvm::class-name-internal thing)))
               (t (string thing)))))
      (format nil "~A__~{~A~^__~}"
              (stringify returns)
              (mapcar #'stringify args))))
  
  (defun %define-jna-callback-interface (returns args)
  