Changeset 5462


Ignore:
Timestamp:
Nov 3, 2006, 12:46:02 PM (18 years ago)
Author:
Gary Byers
Message:

CANONICALIZE-SPECIALIZERS optionally returns its argument if all members are SPECIALIZERS.

Use CANONICALIZE-SPECIALIZERS to canonicalize FIND-METHOD arguments, for the benefit
of people who haven't read the MOP spec or who don't realize that the MOP defines
some things differently from CLHS.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/level-1/l1-clos-boot.lisp

    r5377 r5462  
    668668    (setf (fdefinition function-name) gf))
    669669
    670 (defun canonicalize-specializers (specializers)
     670(defun canonicalize-specializers (specializers &optional (copy t))
    671671  (flet ((canonicalize-specializer (spec)
    672672           (if (specializer-p spec)
     
    680680                 (intern-eql-specializer (cadr spec))
    681681                 (error "Unknown specializer form ~s" spec))))))
    682     (mapcar #'canonicalize-specializer specializers)))
     682    (if (and (not copy)
     683             (dolist (s specializers t)
     684               (unless (specializer-p s) (return nil))))
     685      specializers
     686      (mapcar #'canonicalize-specializer specializers))))
    683687
    684688(defun ensure-method (name specializers &rest keys &key (documentation nil doc-p) qualifiers
     
    23002304            s)
    23012305        (when (equal q method-qualifiers)
    2302           (dolist (spec specializers #|(canonicalize-specializers specializers)|#
     2306          (dolist (spec (canonicalize-specializers specializers nil)
    23032307                   (if (null ss)
    23042308                     (return-from find-method m)
Note: See TracChangeset for help on using the changeset viewer.