(in-package #:alien) (defmacro call (fname rtype &rest types-n-values) (let ((tlist (queue:new)) (vlist (queue:new))) (do () ((null types-n-values) nil) (queue:add tlist (pop types-n-values)) (queue:add vlist (pop types-n-values))) `(alien-funcall (extern-alien ,fname (sb-alien:function ,rtype ,@(queue:to-list tlist))) ,@(queue:to-list vlist))))