;;; Compile a version of BODY for all TYPES, and dispatch to the
;;; correct one based on the value of VAR. This was originally used
;;; only for strings, hence the name. Renaming it to something more
;;; generic might not be a bad idea.
(defmacro string-dispatch ((&rest types) var &body body)
;;; Compile a version of BODY for all TYPES, and dispatch to the
;;; correct one based on the value of VAR. This was originally used
;;; only for strings, hence the name. Renaming it to something more
;;; generic might not be a bad idea.
(defmacro string-dispatch ((&rest types) var &body body)
- collect `(,type (,fun (the ,type ,var))))))))
+ ;; TRULY-THE allows transforms to take advantage of the type
+ ;; information without need for constraint propagation.
+ collect `(,type (,fun (truly-the ,type ,var))))))))
;;; Return a list of N gensyms. (This is a common suboperation in
;;; macros and other code-manipulating code.)
;;; Return a list of N gensyms. (This is a common suboperation in
;;; macros and other code-manipulating code.)
-(declaim (ftype (function (index) list) make-gensym-list))
-(defun make-gensym-list (n)
- (loop repeat n collect (block-gensym)))
+(declaim (ftype (function (index &optional t) (values list &optional))
+ make-gensym-list))
+(defun make-gensym-list (n &optional name)
+ (case name
+ ((t)
+ (loop repeat n collect (gensym)))
+ ((nil)
+ (loop repeat n collect (block-gensym)))
+ (otherwise
+ (loop repeat n collect (gensym name)))))