From a138a2b2921d7fc0329a21d2dbabe4211ff4ef3e Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Tue, 12 Feb 2008 16:25:03 +0100 Subject: Add a policy for distinguishing between char and BOOL return values. darcs-hash:09dbdf5e230a28071f1933a48077d562065df71f --- Lisp/method-invocation.lisp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Lisp/method-invocation.lisp') diff --git a/Lisp/method-invocation.lisp b/Lisp/method-invocation.lisp index 4408a1b..929162f 100644 --- a/Lisp/method-invocation.lisp +++ b/Lisp/method-invocation.lisp @@ -423,6 +423,13 @@ easier to use with __apply__. (make-pointer-wrapper (car return-type) :pointer (cffi:mem-ref objc-return-value-cell return-c-type)))) + ((:char :unsigned-char) + ;; FIXME: This is non-trivial. See policy.lisp for + ;; details. + (objc-char->lisp-value (cffi:mem-ref objc-return-value-cell + return-c-type) + receiver + selector)) ((:void) (values)) (otherwise (cffi:mem-ref objc-return-value-cell return-c-type))))))))) @@ -565,6 +572,12 @@ easier to use with __apply__. +yes+) +;; Note that this refers to the Lisp BOOLEAN type, not the Objective-C +;; BOOL type. +(defcoercion boolean ((x number)) + (not (zerop x))) + + (defcoercion string ((x string)) x) -- cgit v1.2.3