changeset 58565:24b04ef917a7

(cl-parse-loop-clause, labels): Use gensym rather than make-symbol for symbols which are used in a symbol-macrolet or equivalent.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sat, 27 Nov 2004 00:18:14 +0000
parents eea39a81fd89
children b5f77e7bd232
files lisp/emacs-lisp/cl-macs.el
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/cl-macs.el	Sat Nov 27 00:17:22 2004 +0000
+++ b/lisp/emacs-lisp/cl-macs.el	Sat Nov 27 00:18:14 2004 +0000
@@ -715,7 +715,10 @@
       (let ((loop-for-bindings nil) (loop-for-sets nil) (loop-for-steps nil)
 	    (ands nil))
 	(while
-	    (let ((var (or (pop args) (make-symbol "--cl-var--"))))
+	    ;; Use `gensym' rather than `make-symbol'.  It's important that
+	    ;; (not (eq (symbol-name var1) (symbol-name var2))) because
+	    ;; these vars get added to the cl-macro-environment.
+	    (let ((var (or (pop args) (gensym "--cl-var--"))))
 	      (setq word (pop args))
 	      (if (eq word 'being) (setq word (pop args)))
 	      (if (memq word '(the each)) (setq word (pop args)))
@@ -1314,7 +1317,10 @@
 \(fn ((FUNC ARGLIST BODY...) ...) FORM...)"
   (let ((vars nil) (sets nil) (cl-macro-environment cl-macro-environment))
     (while bindings
-      (let ((var (make-symbol "--cl-var--")))
+      ;; Use `gensym' rather than `make-symbol'.  It's important that
+      ;; (not (eq (symbol-name var1) (symbol-name var2))) because these
+      ;; vars get added to the cl-macro-environment.
+      (let ((var (gensym "--cl-var--")))
 	(push var vars)
 	(push (list 'function* (cons 'lambda (cdar bindings))) sets)
 	(push var sets)