Changeset 814


Ignore:
Timestamp:
May 7, 2004, 1:23:19 AM (21 years ago)
Author:
Gary Byers
Message:

Handle new issues with :foreign-type (non-standard slot options collect
values into a list.)

File:
1 edited

Legend:

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

    r614 r814  
    314314
    315315(defclass foreign-direct-slot-definition (direct-slot-definition)
    316   ((foreign-type :initarg :foreign-type :initform :id :accessor foreign-slot-definition-foreign-type)
     316  ((foreign-type :initform :id :accessor foreign-slot-definition-foreign-type)
    317317   (offset :initarg :offset
    318318           :initform nil
     
    321321offset, relative to the start of the instance's slots.  The corresponding
    322322effective slot definition's offset is a product of this value and the
    323 instance_size of its ObjC superclass."))
    324   (:default-initargs :foreign-type :id))
     323instance_size of its ObjC superclass.")))
     324
     325(defmethod shared-initialize :after ((slotd foreign-direct-slot-definition)
     326                                     slot-names
     327                                     &key (foreign-type '(:id)))
     328  (declare (ignore slot-names))
     329  (if (and (consp foreign-type)
     330           (null (cdr foreign-type)))
     331    (setf (foreign-slot-definition-foreign-type slotd) (car foreign-type))
     332    (error "~S must be a 1-element list" foreign-type)))
    325333
    326334(defclass foreign-effective-slot-definition (effective-slot-definition)
     
    417425            (make-direct-slot-definition
    418426             class
    419              `(:foreign-type ,slot-type :offset ,offset ,@initargs))))
     427             `(:foreign-type ,(list slot-type) :offset ,offset ,@initargs))))
    420428      slot)))
    421429           
Note: See TracChangeset for help on using the changeset viewer.