Changeset 5863


Ignore:
Timestamp:
Feb 2, 2007, 1:27:51 AM (18 years ago)
Author:
Gary Byers
Message:

Try to fix another case involving "auxiliary types".

I think that the concept of auxiliary types might make sense in a context
like:

(def-foreign-type nil

(:struct :foo

(:a :int)
(:b (:struct :bar (:x :int) (:y :int)))))

In that case, :struct :bar is local to the definition. In the similar
case:

(def-foreign-type nil

(:struct :foo

(:a :int)
(:b (:struct :bar))))

:BAR is presumably defined (globally) elsewhere.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/lib/foreign-types.lisp

    r5829 r5863  
    984984(defun parse-foreign-record-type (kind name fields)
    985985  (if fields
    986       (let* ((old (and name (auxiliary-foreign-type kind name)))
    987              (result (if (or (null old)
    988                              (foreign-record-type-fields old))
    989                          (make-foreign-record-type :name name :kind kind)
    990                          old)))
    991         (when (and name (not (eq old result)))
    992           (setf (auxiliary-foreign-type kind name) result))
    993         (parse-foreign-record-fields result fields)
    994         result)
    995       (if name
    996           (or (auxiliary-foreign-type kind name)
    997               (setf (auxiliary-foreign-type kind name)
    998                     (make-foreign-record-type :name name :kind kind)))
    999           (make-foreign-record-type :kind kind))))
     986    (let* ((old (and name (auxiliary-foreign-type kind name)))
     987           (result (or old
     988                       (make-foreign-record-type :name name :kind kind))))
     989      (when (and name (not (eq old result)))
     990        (setf (auxiliary-foreign-type kind name) result))
     991      (parse-foreign-record-fields result fields)
     992      result)
     993    (if name
     994      (or (auxiliary-foreign-type kind name)
     995          (setf (auxiliary-foreign-type kind name)
     996                (make-foreign-record-type :name name :kind kind)))
     997      (make-foreign-record-type :kind kind))))
    1000998
    1001999;;; PARSE-FOREIGN-RECORD-FIELDS -- internal
Note: See TracChangeset for help on using the changeset viewer.