Changeset 455


Ignore:
Timestamp:
Feb 1, 2004, 11:37:35 AM (21 years ago)
Author:
beer
Message:

Move toward the use of FIND-CLASS and CLASS-OF

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/examples/bridge.lisp

    r452 r455  
    77;;;;   (1) Convenient Lisp syntax for instantiating ObjC classes
    88;;;;   (2) Convenient Lisp syntax for invoking ObjC methods
    9 ;;;;   (3) Ability to define CLOS subclasses of ObjC class with Lisp slots
    10 ;;;;       and have their instances be usable as ObjC objects (eventually)
    11 ;;;;   (4) Ability to define CLOS methods on ObjC classes and have them be
    12 ;;;;       invoked by ObjC if they match an ObjC method name (eventually)
    139;;;;
    1410;;;; Copyright (c) 2003 Randall D. Beer
     
    133129(defun find-objc-class (cname)
    134130  (%objc-class-classptr
    135    (if (symbolp cname)
    136        (load-objc-class-descriptor (lisp-to-objc-classname cname))
     131   (if (symbolp cname) 
     132       (find-class cname)
    137133     (load-objc-class-descriptor cname))))
    138134
     
    142138                     
    143139(defun objc-class-of (o)
    144   (multiple-value-bind (ignore class) (objc-object-p o)
    145     (declare (ignore ignore))
    146     (if (null class)
    147       (error "~S is not an ObjC object" o)
    148       class)))
     140  (if (objc-object-p o)
     141      (class-of o)
     142    (error "~S is not an ObjC object" o)))
    149143
    150144
     
    153147
    154148(defun get-objc-class-from-declaration (otype)
    155   (cond ((symbolp otype)
    156          (lookup-objc-class (lisp-to-objc-classname otype)))
     149  (cond ((symbolp otype) (lookup-objc-class (lisp-to-objc-classname otype)))
    157150        ((and (consp otype) (eq (first otype) '@metaclass))
    158151         (let* ((name (second otype))
Note: See TracChangeset for help on using the changeset viewer.