Changeset 15135


Ignore:
Timestamp:
Dec 13, 2011, 9:11:22 PM (8 years ago)
Author:
rme
Message:

Don't warn about the same initarg appearing in more than one slot.

The standard allows this:
http://www.lispworks.com/documentation/HyperSpec/Body/07_ad.htm

"A given initialization argument can be used to initialize more than
one slot if the same initialization argument name appears in more than
one :initarg slot option."

(This undoes r11735).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lib/macros.lisp

    r15111 r15135  
    19801980    (let* ((options-seen ())
    19811981           (signatures ())
    1982            (slot-names ())
    1983            (slot-initargs ()))
     1982           (slot-names ()))
    19841983      (flet ((canonicalize-defclass-option (option)
    19851984               (let* ((option-name (car option)))
     
    20562055                          (push setf-name writers))))
    20572056                     (:initarg
    2058                       (let* ((initarg (require-type (cadr options) 'symbol))
    2059                              (other (position initarg slot-initargs :test #'memq)))
    2060                         (when other
    2061                           (warn "Initarg ~s occurs in both ~s and ~s slots"
    2062                                 initarg (nth (1+ other) slot-names) slot-name))
    2063                         (push initarg initargs)))
     2057                      (push (require-type (cadr options) 'symbol) initargs))
    20642058                     (:type
    20652059                      (if type-p
     
    20952089                                       (car (push (list (car options)) other-options)))))
    20962090                        (push (cadr options) (cdr pair))))))
    2097                  (push initargs slot-initargs)
    20982091                 `(list :name ',slot-name
    20992092                   ,@(when allocation `(:allocation ',allocation))
Note: See TracChangeset for help on using the changeset viewer.