summaryrefslogtreecommitdiff
path: root/Lisp/type-conversion.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'Lisp/type-conversion.lisp')
-rw-r--r--Lisp/type-conversion.lisp12
1 files changed, 11 insertions, 1 deletions
diff --git a/Lisp/type-conversion.lisp b/Lisp/type-conversion.lisp
index 3ac1ce6..066fdd9 100644
--- a/Lisp/type-conversion.lisp
+++ b/Lisp/type-conversion.lisp
@@ -35,11 +35,21 @@
(otherwise value)))))
+(defmacro with-foreign-conversion (bindings &body body)
+ `(with-foreign-objects
+ ,(mapcar #'(lambda (name-value-pair)
+ (destructuring-bind (name value)
+ name-value-pair
+ `(,name (lisp->obj-data ,value))))
+ bindings)
+ ,@body))
+
+
(defmacro with-foreign-objects (bindings &body body)
`(let ,(mapcar #'(lambda (name-value-pair)
(destructuring-bind (name value)
name-value-pair
- `(,name (lisp->obj-data ,value))))
+ `(,name ,value)))
bindings)
(unwind-protect
(progn ,@body)