summaryrefslogtreecommitdiff
path: root/Lisp/method-invocation.lisp
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2008-02-14 21:58:44 +0100
committerMatthias Benkard <code@mail.matthias.benkard.de>2008-02-14 21:58:44 +0100
commit8d87e7250e5046e771a8383098032290c9a2f9b1 (patch)
treea7a114f0c2dc8a8852cd8c0438bd356aa7da3d88 /Lisp/method-invocation.lisp
parentb2c371b10aff7125ae5cbfd83ba643e77b1bfb87 (diff)
Support passing booleans to Objective-C methods.
darcs-hash:ab45821977fdf6dec25f869ad5bda8760c805b4f
Diffstat (limited to 'Lisp/method-invocation.lisp')
-rw-r--r--Lisp/method-invocation.lisp15
1 files changed, 14 insertions, 1 deletions
diff --git a/Lisp/method-invocation.lisp b/Lisp/method-invocation.lisp
index dd36dd3..c0e44ac 100644
--- a/Lisp/method-invocation.lisp
+++ b/Lisp/method-invocation.lisp
@@ -406,7 +406,20 @@ easier to use with __apply__.
;; it's the best we can do.
(setf (argref arg-c-type i)
(pointer-to (coerce-object arg 'id))))
- (t (setf (argref arg-c-type i) arg)))))
+ (t (setf (argref arg-c-type i)
+ (case arg
+ ;; Do the right thing for booleans.
+ ;;
+ ;; Note that Objective-C method
+ ;; invocations do not understand
+ ;; generalised booleans. Among other
+ ;; things, this means that passing 0
+ ;; for a boolean is the same as
+ ;; passing NIL, not the same as
+ ;; passing T.
+ ((nil) 0)
+ ((t) 1)
+ (otherwise arg)))))))
(let* ((error-cell
(%objcl-invoke-with-types (- argc 2)
return-typestring