Reimplement WITH-UNIQUE-NAMES using LET* and GENSYM instead of block-gensym

This commit is contained in:
Juan Jose Garcia Ripoll 2009-09-05 11:40:22 +02:00
parent 9866109ea6
commit c4cf6ad491

View file

@ -134,11 +134,11 @@
;;; Incidentally, this is essentially the same operator which
;;; _On Lisp_ calls WITH-GENSYMS.
(defmacro with-unique-names (symbols &body body)
`(let ,(mapcar (lambda (symbol)
(let* ((symbol-name (symbol-name symbol))
(stem (if (every #'alpha-char-p symbol-name)
`(let* ,(mapcar (lambda (symbol)
(let* ((symbol-name (symbol-name symbol))
(stem (if (every #'alpha-char-p symbol-name)
symbol-name
(concatenate 'string symbol-name "-"))))
`(,symbol (block-gensym ,stem))))
symbols)
`(,symbol (gensym ,stem))))
symbols)
,@body))