From b423c77db3caafb5eeb55cf185893aba8c23b842 Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Mon, 6 Aug 2007 17:46:06 +0200 Subject: More cleanups. darcs-hash:71c91c19f791ff48c670b718e4b9cecd96465ee8 --- Lisp/libobjcl.lisp | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/Lisp/libobjcl.lisp b/Lisp/libobjcl.lisp index 9591f8f..b38aa6e 100644 --- a/Lisp/libobjcl.lisp +++ b/Lisp/libobjcl.lisp @@ -148,13 +148,22 @@ conventional case for namespace identifiers in Objective C." (defun find-objc-class-by-name (class-name) (with-foreign-objects ((obj-data (%objcl-find-class class-name))) - (unwind-protect - (if (null-pointer-p (foreign-slot-value - (foreign-slot-value obj-data 'obj-data 'data) - 'obj-data-union - 'class-val)) - nil - (obj-data->lisp obj-data))))) + (if (null-pointer-p (foreign-slot-value + (foreign-slot-value obj-data 'obj-data 'data) + 'obj-data-union + 'class-val)) + nil + (obj-data->lisp obj-data)))) + + +(defun find-selector-by-name (selector-name) + (with-foreign-objects ((obj-data (%objcl-find-selector selector-name))) + (if (null-pointer-p (foreign-slot-value + (foreign-slot-value obj-data 'obj-data 'data) + 'obj-data-union + 'sel-val)) + nil + (obj-data->lisp obj-data)))) (defun objcl-class-name (class) @@ -222,15 +231,3 @@ by which __invoke__ converts its arguments into a *message name*. (string (find-selector-by-name selector-name)) (list (find-selector-by-name (symbol-list->message-name selector-name))))) - - -(defun find-selector-by-name (selector-name) - (let ((obj-data (%objcl-find-selector selector-name))) - (prog1 - (if (null-pointer-p (foreign-slot-value - (foreign-slot-value obj-data 'obj-data 'data) - 'obj-data-union - 'sel-val)) - nil - (obj-data->lisp obj-data)) - (dealloc-obj-data obj-data)))) -- cgit v1.2.3