anchor.diff:    value)
   
   ;;;# Foreign Globals
  -
  -(defun %foreign-symbol-pointer (name library)
  -  "Returns a pointer to a foreign symbol NAME."
  -  (flet ((find-it (library)
  -           (ignore-errors
  -            (make-pointer
  -             (jcall-raw
  -              (private-jmethod "com.sun.jna.NativeLibrary" "getSymbolAddress")
  -              library name)))))
  -    (if (eq library :default)
  -        (or (find-it
  -             (jstatic "getProcess" "com.sun.jna.NativeLibrary"))
  -            ;; The above should find it, but I'm not exactly sure, so
  -            ;; let's still do it manually just in case.
  -            (loop for lib being the hash-values of *loaded-libraries*
  -                  thereis (find-it lib)))
  -        (find-it library))))
  +(let ((get-symbol-address-jmethod (private-jmethod "com.sun.jna.NativeLibrary" "getSymbolAddress")))
  +  (defun %foreign-symbol-pointer (name library)
  +    "Returns a pointer to a foreign symbol NAME."
  +    (flet ((find-it (library)
  +             (ignore-errors
  +               (make-pointer
  +                (jcall-raw get-symbol-address-jmethod library name)))))
  +      (if (eq library :default)
  +          (or (find-it
  +               (jstatic "getProcess" "com.sun.jna.NativeLibrary"))
  +              ;; The above should find it, but I'm not exactly sure, so
  +              ;; let's still do it manually just in case.
  +              (loop for lib being the hash-values of *loaded-libraries*
  +                 thereis (find-it lib)))
  +          (find-it library)))))
   
   ;;;# Calling Foreign Functions
   
  
positive.code:                      :test #'string=)))
      (jcall (jmethod "java.lang.reflect.Field" "setAccessible" "boolean")
             field +true+)
      (jcall (jmethod "java.lang.reflect.Field" "get" "java.lang.Object")
             field instance)))
  
  ;;; XXX: doesn't match jmethod-arguments.
  (defun private-jmethod (class-name method-name)
    (let ((method (find method-name
                        (jcall (jmethod "java.lang.Class" "getDeclaredMethods")
                               (jclass class-name))
                        :key #'jmethod-name
                        :test #'string=)))
      (jcall (jmethod "java.lang.reflect.Method" "setAccessible" "boolean")
             method +true+)
      method))
  
  (defun private-jconstructor (class-name &rest params)
    (let* ((param-classes (mapcar #'jclass params))
           (cons (find-if (lambda (x &aux (cons-params (jconstructor-params x)))
                            (and (length= param-classes cons-params)
                                 (loop for param in param-classes
                                       and param-x across cons-params
                                       always (string= (jclass-name param)
                                                       (jclass-name param-x)))))
                          (jcall (jmethod "java.lang.Class"
                                          "getDeclaredConstructors")
                                 (jclass class-name)))))
      (jcall (jmethod "java.lang.reflect.Constructor" "setAccessible" "boolean")
             cons +true+)
      cons))
  
  ;;;# Symbol Case
  
  (defun canonicalize-symbol-name-case (name)
    (string-upcase name))
  
  ;;;# Pointers
  
  (deftype foreign-pointer ()
    '(satisfies pointerp))
  
  (defun pointerp (ptr)
    "Return true if PTR is a foreign pointer."
    (let ((jclass (jclass-of ptr)))
      (when jclass
        (jclass-superclass-p (jclass "com.sun.jna.Pointer") jclass))))
  
  (defun make-pointer (address)
    "Return a pointer pointing to ADDRESS."
    (jnew (private-jconstructor "com.sun.jna.Pointer" "long") address))
  
  (defun %pointer-address (pointer)
    (private-jfield "com.sun.jna.Pointer" "peer" pointer))
  
  (defun pointer-address (pointer)
    "Return the address pointed to by PTR."
  
negative.code: 
  ;;;
  
  ;;; FIXME! We should probably define a private-jfield-accessor that does the hard work once!
  (let ((get-declared-fields-jmethod (jmethod "java.lang.Class" "getDeclaredFields")))
    (defun private-jfield (class-name field-name instance)
      (let ((field (find field-name
                         (jcall get-declared-fields-jmethod
                                (jclass class-name))
                         :key #'jfield-name
                         :test #'string=)))
        (jcall (jmethod "java.lang.reflect.Field" "setAccessible" "boolean")
               field +true+)
        (jcall (jmethod "java.lang.reflect.Field" "get" "java.lang.Object")
               field instance))))
  
  ;;; XXX: doesn't match jmethod-arguments.
  
  (let ((get-declared-methods-jmethod (jmethod "java.lang.Class" "getDeclaredMethods")))
    (defun private-jmethod (class-name method-name)
      (let ((method (find method-name
                          (jcall get-declared-methods-jmethod
                                 (jclass class-name))
                          :key #'jmethod-name
                          :test #'string=)))
        (jcall (jmethod "java.lang.reflect.Method" "setAccessible" "boolean")
               method +true+)
        method)))
  
  (let ((get-declared-constructors-jmethod (jmethod "java.lang.Class"
                                                    "getDeclaredConstructors"))
        (set-accessible-jmethod (jmethod "java.lang.reflect.Constructor" "setAccessible" "boolean")))
    (defun private-jconstructor (class-name &rest params)
      (let* ((param-classes (mapcar #'jclass params))
             (cons (find-if (lambda (x &aux (cons-params (jconstructor-params x)))
                              (and (length= param-classes cons-params)
                                   (loop for param in param-classes
                                      and param-x across cons-params
                                      always (string= (jclass-name param)
                                                      (jclass-name param-x)))))
                            (jcall get-declared-constructors-jmethod (jclass class-name)))))
        (jcall set-accessible-jmethod cons +true+)
        cons)))
  
  ;;;# Symbol Case
  
  (defun canonicalize-symbol-name-case (name)
    (string-upcase name))
  
  ;;;# Pointers
  
  (deftype foreign-pointer ()
    '(satisfies pointerp))
  
  (defun pointerp (ptr)
    "Return true if PTR is a foreign pointer."
    (let ((jclass (jclass-of ptr)))
      (when jclass
        (jclass-superclass-p (jclass "com.sun.jna.Pointer") jclass))))
  
  (let ((jconstructor (private-jconstructor "com.sun.jna.Pointer" "long")))
    (defun make-pointer (address)
      "Return a pointer pointing to ADDRESS."
      (jnew jconstructor address)))
  
  (defun make-private-jfield-accessor (class-name field-name)
    (let ((field (find field-name
                       (jcall (jmethod "java.lang.Class" "getDeclaredFields")
                              (jclass class-name))
  