summaryrefslogtreecommitdiff
path: root/Lisp/type-conversion.lisp
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2008-03-24 13:28:45 +0100
committerMatthias Benkard <code@mail.matthias.benkard.de>2008-03-24 13:28:45 +0100
commitaa8645cdf28eb7b13d2813f5f0fe014df4d7b4b8 (patch)
tree7ea1e014c0af0501938d0a377071460016078e19 /Lisp/type-conversion.lisp
parent1deb19a20e934084cda4499e6930e35b0d2777c3 (diff)
When receiving a Lisp value wrapper from Objective-C, unwrap it automatically.
darcs-hash:f1b183f46c4d97c27121e0ada8614b9e9feb9955
Diffstat (limited to 'Lisp/type-conversion.lisp')
-rw-r--r--Lisp/type-conversion.lisp14
1 files changed, 11 insertions, 3 deletions
diff --git a/Lisp/type-conversion.lisp b/Lisp/type-conversion.lisp
index 9796104..5be0f12 100644
--- a/Lisp/type-conversion.lisp
+++ b/Lisp/type-conversion.lisp
@@ -25,9 +25,17 @@
(typespec-primary-type typespec))
((id objective-c-class exception selector)
(let ((*skip-retaining* skip-retaining-p))
- (intern-pointer-wrapper (typespec-primary-type typespec)
- :pointer (cffi:mem-ref foreign-value-cell
- c-type))))
+ (let ((instance
+ (intern-pointer-wrapper (typespec-primary-type typespec)
+ :pointer (cffi:mem-ref
+ foreign-value-cell
+ c-type))))
+ (typecase instance
+ (lisp-value-wrapper-mixin
+ (if *skip-value-wrapper-unwrapping*
+ instance
+ (lisp-value instance)))
+ (t instance)))))
((:char :unsigned-char)
;; FIXME? This is non-trivial. See policy.lisp for
;; details.