diff options
author | Matthias Benkard <code@mail.matthias.benkard.de> | 2008-02-12 16:25:03 +0100 |
---|---|---|
committer | Matthias Benkard <code@mail.matthias.benkard.de> | 2008-02-12 16:25:03 +0100 |
commit | a138a2b2921d7fc0329a21d2dbabe4211ff4ef3e (patch) | |
tree | a048bae191486ab698c96acf5cefe3f56dd03117 /Lisp/method-invocation.lisp | |
parent | fc097fadb088e6c563f339d2b2090cee45295194 (diff) |
Add a policy for distinguishing between char and BOOL return values.
darcs-hash:09dbdf5e230a28071f1933a48077d562065df71f
Diffstat (limited to 'Lisp/method-invocation.lisp')
-rw-r--r-- | Lisp/method-invocation.lisp | 13 |
1 files changed, 13 insertions, 0 deletions
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) |