anchor.diff:  
   (defun foreign-funcall-type-and-args (args)
     "Return an SB-ALIEN function type for ARGS."
  -  (let ((return-type 'void))
  -    (loop for (type arg) on args by #'cddr
  -          if arg collect (convert-foreign-type type) into types
  -          and collect arg into fargs
  -          else do (setf return-type (convert-foreign-type type))
  -          finally (return (values types fargs return-type)))))
  +  (let ((return-type 'void)
  +        types
  +        fargs)
  +    (loop while args
  +          do (let ((type (pop args)))
  +               (cond ((eq type '&optional)
  +                      (push type types))
  +                     ((not args)
  +                      (setf return-type (convert-foreign-type type)))
  +                     (t
  +                      (push (convert-foreign-type type) types)
  +                      (push (pop args) fargs)))))
  +    (values (nreverse types)
  +            (nreverse fargs)
  +            return-type)))
   
   (defmacro %%foreign-funcall (name types fargs rettype)
     "Internal guts of %FOREIGN-FUNCALL."
  
positive.code:     (with-unique-names (function)
        `(with-alien ((,function (* (function ,rettype ,@types)) ,ptr))
           (alien-funcall ,function ,@fargs)))))
  
  ;;;# Callbacks
  
  
negative.code:    #:with-foreign-pointer
     #:%foreign-funcall
     #:%foreign-funcall-pointer
     #:%foreign-funcall-varargs
     #:%foreign-funcall-pointer-varargs
     #:%foreign-type-alignment
     #:%foreign-type-size
     #:%load-foreign-library
  