The current HEAD features what I hope is a tolerably fast ALIEN-CALLBACK
(interface slightly changed), and an ALIEN-LAMBDA that should be fine
to use with simple-funs, but less good still for closures -- but anyways
on the order of something I would be willing to call reasonable.
No WITH-ALIEN-CALLBACKS yet, but I do have a plan:
(with-alien-callbacks ((foo <res-type> <typed-lambda-list> ...)
(defvar *local-alien-callbacks* (make-hash-table))
(flet ((foo <lambda-list> ...))
(let ((foo (local-alien-callback <alien-ftype> #'foo)))
So that the callback would be assembled on the first pass though the
form, but on subsequent calls the already-assembled-one would be used.
(Providing the functions aren't closures, of course, in which case we
need to assemble a new wrapper for each...)
Now, this is rather different from both the API and implementation
by Thomas, but I think the win is here for the common case.
I would be more inclined to provide the DX behaviour with a :MALLOC
argument to ALIEN-CALLBACK, and let the users call free() on them when
Comments and questions on names, sematics, and whatnot requested.
Details can be found at the end of target-alieneval.lisp.
-- Nikodemus Schemer: "Buddha is small, clean, and serious."
Lispnik: "Buddha is big, has hairy armpits, and laughs."