Changeset 230


Ignore:
Timestamp:
Jan 5, 2004, 9:19:43 PM (21 years ago)
Author:
Gary Byers
Message:

Derive the names of superclasses when recursively mapping classes; don't
use the name MAP-OBJC-CLASS was called with/defaulted to over and over.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/examples/objc-runtime.lisp

    r185 r230  
    142142              (splay-tree-count objc-metaclass-map) 0
    143143              next-objc-class-id 0)))
    144     (defun map-objc-class (class &optional (class-name
    145                                             (objc-to-lisp-classname
    146                                              (%get-cstring
    147                                               (pref class :objc_class.name))
    148                                              "NS")
    149                                             class-name-p))
     144    (defun map-objc-class (class &optional (name nil name-p))
    150145      "ensure that the class (and metaclass) are mapped to a small integer"
    151146      (with-lock-grabbed (objc-class-lock)
    152         (labels ((ensure-mapped-class (class)
     147        (labels ((ensure-mapped-class (class &optional
     148                                             (class-name
     149                                              (objc-to-lisp-classname
     150                                               (%get-cstring
     151                                                (pref class :objc_class.name))
     152                                               "NS")
     153                                              class-name-p))
    153154                   (ensure-objc-classptr-resolved class)
    154155                   (with-macptrs ((super (pref class :objc_class.super_class)))
     
    186187                         )
    187188                         id))))
    188           (ensure-mapped-class class))))
     189          (if name-p
     190            (ensure-mapped-class class name)
     191            (ensure-mapped-class class)))))
    189192    (defun objc-class-id (class)
    190193      (with-lock-grabbed (objc-class-lock)
Note: See TracChangeset for help on using the changeset viewer.