From bbf46f625cb69a3f99659222bd34f116e0c3ac76 Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Sun, 3 Feb 2008 00:18:04 +0100 Subject: Automatically export newly defined wrapper classes. darcs-hash:94ee737ab79b1cca1de896b9d6cdbcca06db1071 --- Lisp/name-conversion.lisp | 17 ++++++++++++----- Lisp/utilities.lisp | 4 ++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Lisp/name-conversion.lisp b/Lisp/name-conversion.lisp index 9b27e70..4ff637c 100644 --- a/Lisp/name-conversion.lisp +++ b/Lisp/name-conversion.lisp @@ -64,6 +64,11 @@ (subseq (first components) 1)))))) +(defun export-and-return (symbol) + (export (list symbol)) + symbol) + + (defun objc-class-name->symbol (class-name) (let ((prefix-end (1- (position-if #'lower-case-p class-name)))) (cond ((and prefix-end (> prefix-end 0)) @@ -98,12 +103,14 @@ ;; because we want this procedure to work as expected for any value ;; of (READTABLE-CASE *READTABLE*), which means that 'ns-object ;; should always mean the same thing as "NSObject". - (read-from-string class-name))) + (export-and-return + (read-from-string class-name)))) (defun objc-meta-class-name->symbol (meta-class-name) (let ((*package* (find-package '#:objective-c-classes))) - (read-from-string - (concatenate 'string - "%" - (symbol-name (objc-class-name->symbol meta-class-name)))))) + (export-and-return + (read-from-string + (concatenate 'string + "%" + (symbol-name (objc-class-name->symbol meta-class-name))))))) diff --git a/Lisp/utilities.lisp b/Lisp/utilities.lisp index ccf80cf..5310f91 100644 --- a/Lisp/utilities.lisp +++ b/Lisp/utilities.lisp @@ -251,7 +251,7 @@ invocations will return numbers.) (defmethod print-object ((class objective-c-class) stream) (print-unreadable-object (class stream) (with-slots (pointer) class - (format stream "~S ~A {~X}" + (format stream "~S ~S {~X}" (type-of class) (class-name class) (cffi:pointer-address pointer))))) @@ -260,7 +260,7 @@ invocations will return numbers.) (defmethod print-object ((meta-class objective-c-meta-class) stream) (print-unreadable-object (meta-class stream) (with-slots (pointer) meta-class - (format stream "~S ~A {~X}" + (format stream "~S ~S {~X}" (type-of meta-class) (class-name meta-class) (cffi:pointer-address pointer))))) -- cgit v1.2.3