0.9.1.38:
[sbcl.git] / src / code / early-extensions.lisp
index 13638c4..f87de04 100644 (file)
 
 (defmacro define-cached-synonym
     (name &optional (original (symbolicate "%" name)))
-  (let ((cached-name (symbolicate "%%" name "-cached")))
+  (let ((cached-name (symbolicate "%%" name "-CACHED")))
     `(progn
        (defun-cached (,cached-name :hash-bits 8
                                    :hash-function (lambda (x)
 (defun legal-fun-name-p (name)
   (values (valid-function-name-p name)))
 
+(deftype function-name () '(satisfies legal-fun-name-p))
+
 ;;; Signal an error unless NAME is a legal function name.
 (defun legal-fun-name-or-type-error (name)
   (unless (legal-fun-name-p name)
     (error 'simple-type-error
           :datum name
-          :expected-type '(or symbol list)
+          :expected-type 'function-name
           :format-control "invalid function name: ~S"
           :format-arguments (list name))))
 
        (%failed-enforce-type ,value ',type))))
 
 (defun %failed-enforce-type (value type)
-  (error 'simple-type-error ; maybe should be TYPE-BUG, subclass of BUG?
-        :value value
+  ;; maybe should be TYPE-BUG, subclass of BUG?  If it is changed,
+  ;; check uses of it in user-facing code (e.g. WARN)
+  (error 'simple-type-error 
+        :datum value
         :expected-type type
         :format-control "~@<~S ~_is not a ~_~S~:>"
         :format-arguments (list value type)))