summaryrefslogtreecommitdiff
path: root/Lisp/type-conversion.lisp
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2007-08-06 17:44:07 +0200
committerMatthias Benkard <code@mail.matthias.benkard.de>2007-08-06 17:44:07 +0200
commite562ec45a61b6b60fdbacf609ece03d998452b95 (patch)
treed99d9d1cd257c7d0d46fba9c508741de12cca5c0 /Lisp/type-conversion.lisp
parentc191d8f49e58bbc5b769780a0a17b5cec82174f1 (diff)
Minor cleanups.
darcs-hash:ee74b33660af9dc6b1e0207285907211dd7e600a
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)