From f190cd760eda23428fe3de22f59d72e504acf1c9 Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Thu, 4 Dec 2008 21:36:48 +0100 Subject: Properly handle typespec designators in foreign slot definitions. darcs-hash:9f85e333862e6181f269fa737f65c4b964526311 --- Lisp/class-definition.lisp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Lisp/class-definition.lisp b/Lisp/class-definition.lisp index 1c01a7f..6f89585 100644 --- a/Lisp/class-definition.lisp +++ b/Lisp/class-definition.lisp @@ -413,6 +413,21 @@ __define-objective-c-method__" (mapcar #'(lambda (x) (getf x :foreign-type)) ivars))) + (direct-slots-with-typespecs + ;; Convert typespec designators into typespecs. + (mapcar #'(lambda (x) + (if (or (null (getf x :foreign-type nil)) + (typespec-p (getf x :foreign-type nil))) + x + (let ((new-slotd (copy-list x)) + (designator (getf x :foreign-type))) + (setf (getf new-slotd :foreign-type) + (list->typespec + (if (listp designator) + designator + (list designator '())))) + (print new-slotd)))) + direct-slots)) (metaclass (ensure-class (objc-meta-class-name->symbol (symbol->objc-class-name name)) @@ -424,7 +439,7 @@ __define-objective-c-method__" (ensure-class (intern (symbol-name name) '#:objective-c-classes) :metaclass metaclass :pointer new-class-pointer - :direct-slots direct-slots + :direct-slots direct-slots-with-typespecs :direct-superclasses direct-superclasses :direct-default-initargs direct-default-initargs :new-foreign-class-p t))) -- cgit v1.2.3