From a8b56704b52488f2865387d8cded8e5f13cdf919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Mon, 16 Jan 2023 00:30:57 -0300 Subject: Add alien call similar to what chezscheme has --- alien.lisp | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 alien.lisp (limited to 'alien.lisp') diff --git a/alien.lisp b/alien.lisp new file mode 100644 index 0000000..3451dc9 --- /dev/null +++ b/alien.lisp @@ -0,0 +1,12 @@ +(in-package #:alien) + +(defmacro call (fname rtype &rest types-n-values) + (let ((tlist (queue:new)) + (vlist (queue:new))) + (dolist (item types-n-values) + (queue:add tlist (first item)) + (queue:add vlist (second item))) + `(alien-funcall (extern-alien ,fname + (function ,rtype + ,@(queue:to-list tlist))) + ,@(queue:to-list vlist)))) -- cgit v1.2.3