Hello cffi'ers, I've been using this lately:
(defvar *lambda-callbacks* nil "TODO: Clean up later somehow?")
(defmacro lambda-callback (return-type args &body body) (let ((name (read-from-string (symbol-name (gensym))))) `(progn (defcallback ,name ,return-type ,args ,@body) (push ',name *lambda-callbacks*) (callback ,name))))
..maybe something like this could be included in cffi? :)