Changeset 451


Ignore:
Timestamp:
Feb 1, 2004, 5:18:41 AM (21 years ago)
Author:
Gary Byers
Message:

NS-LISP-EXCEPTION has a lisp slot. Now, to figure out a way to get rid
of that ...

File:
1 edited

Legend:

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

    r432 r451  
    106106;;; wind up calling THROW-TO-CATCH-FRAME with the specified catch
    107107;;; frame as its second argument.  The C frame used here is just
    108 ;;; an empty C stack frame from which the callback will be called.
     108;; an empty C stack frame from which the callback will be called.
    109109
    110110(defun %associate-jmp-buf-with-catch-frame (jmp-buf catch-frame c-frame)
     
    129129
    130130(defclass ns-lisp-exception (ns::ns-exception)
    131     ((lispid :foreign-type :unsigned))
     131    ((condition :initarg :condition :reader ns-lisp-exception-condition))
    132132  (:metaclass ns::+ns-object))
    133133
    134 (define-objc-method ((:id :init-with-lisp-id (:unsigned lisp-id))
     134(define-objc-method ((:id init)
    135135                     ns-lisp-exception)
    136   (setq self (send-super :init-with-name #@"lisp exception"
    137                          :reason #@"lisp exception"
    138                          :user-info (%null-ptr)))
    139   (setf (slot-value self 'lispid) lisp-id)
    140   self)
    141 
    142 (define-objc-method ((:unsigned lisp-id) ns-lisp-exception)
    143   (slot-value self 'lispid))
     136  (send self
     137        :init-with-name #@"lisp exception"
     138        :reason #@"lisp exception"
     139        :user-info (%null-ptr)))
    144140
    145141(defun ns-exception->lisp-condition (nsexception)
    146   (if (send (send nsexception 'class)
    147             :is-subclass-of-class (@class ns-lisp-exception))
    148     (id-map-free-object *condition-id-map* (send nsexception 'lisp-id))
     142  (if (typep nsexception 'ns-lisp-exception)
     143    (ns-lisp-exception-condition nsexception)
    149144    (make-condition 'ns-exception :ns-exception nsexception)))
    150145
     
    158153  ;;;
    159154
    160   #|(dbg (format nil "~a" c))|#
    161   (make-objc-instance 'ns-lisp-exception
    162                       :with-lisp-id (assign-id-map-id *condition-id-map* c)))
     155  (dbg (format nil "~a" c))
     156  (make-instance 'ns-lisp-exception :condition c))
    163157 
    164158
    165159
    166 (defun ns-exception->lisp-condition (nsexception)
    167   (if (typep nsexception 'ns-lisp-exception)
    168     (id-map-free-object *condition-id-map* (slot-value nsexception 'lispid))
    169     (make-condition 'ns-exception :ns-exception nsexception)))
     160
    170161
    171162#+apple-objc
Note: See TracChangeset for help on using the changeset viewer.