X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcode%2Fprimordial-extensions.lisp;h=8375ea6e444faba1caa900204605820590fcc9f9;hb=4255b37e50876702d2563f3418a44a3f5bf8a2e8;hp=e25ed15cf8932f2555afe854af0243d176a8cc74;hpb=cf4908b857d0a79c609d3535b714a67311fcb59b;p=sbcl.git diff --git a/src/code/primordial-extensions.lisp b/src/code/primordial-extensions.lisp index e25ed15..8375ea6 100644 --- a/src/code/primordial-extensions.lisp +++ b/src/code/primordial-extensions.lisp @@ -145,7 +145,9 @@ (declare (inline ,fun)) (etypecase ,var ,@(loop for type in types - 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)))))))) ;;; Automate an idiom often found in macros: ;;; (LET ((FOO (GENSYM "FOO")) @@ -168,9 +170,16 @@ ;;; 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))))) ;;;; miscellany