diff options
author | Matthias Benkard <code@mail.matthias.benkard.de> | 2008-02-05 22:02:24 +0100 |
---|---|---|
committer | Matthias Benkard <code@mail.matthias.benkard.de> | 2008-02-05 22:02:24 +0100 |
commit | 6ed4ce022d70e3b61fe955755de512d5def5eabc (patch) | |
tree | b417cce8851316d78864133ec529d2445c6d9dfd | |
parent | d1e41d41cf30d941b8d8820c8c2e5bbaf7db4391 (diff) |
Minor cleanups.
darcs-hash:6de1e4c4e8804d949fec6d5af4809fbf5a81ae69
-rw-r--r-- | Lisp/class-definition.lisp | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/Lisp/class-definition.lisp b/Lisp/class-definition.lisp index 130677f..d1a4a74 100644 --- a/Lisp/class-definition.lisp +++ b/Lisp/class-definition.lisp @@ -209,23 +209,18 @@ (defmethod initialize-instance :around ((class objective-c-class) &rest args - &key direct-slots - pointer + &key pointer &allow-other-keys) + ;; We scavenge the class and its superclasses for foreign slots and + ;; add them to our :DIRECT-SLOTS keyword argument. (let ((key-args (copy-list args))) - (dolist (objc-slot (objcl-class-direct-slots/pointer pointer)) - (let ((slot-name - (intern (string-upcase (objcl-slot-name objc-slot)) - (find-package '#:objective-c-classes)))) - (when (notany #'(lambda (slot-definition) - (eql slot-name (car slot-definition))) - direct-slots) - (push (list - :name slot-name - :foreign-name (objcl-slot-name objc-slot) - :foreign-type (parse-typespec - (objcl-slot-type objc-slot))) - (getf key-args :direct-slots))))) + (dolist (objc-slot (objcl-class-direct-slots/pointer pointer)) + (pushnew (list :name (intern (string-upcase (objcl-slot-name objc-slot)) + (find-package '#:objective-c-classes)) + :foreign-name (objcl-slot-name objc-slot) + :foreign-type (parse-typespec (objcl-slot-type objc-slot))) + (getf key-args :direct-slots) + :key #'(lambda (slotd) (getf slotd :name)))) (apply #'call-next-method class key-args))) |