diff tests/automated/lisp-tests.el @ 5462:97ac18bd1fa3

Make sure distinct symbol macros with identical names expand distinctly. lisp/ChangeLog addition: 2011-04-24 Aidan Kehoe <kehoea@parhasard.net> * cl-macs.el (symbol-macrolet): * cl-macs.el (lexical-let): * cl.el: * cl.el (cl-macroexpand): Distinct symbol macros with identical string names should nonetheless expand to different things; implement this, storing the symbol's eq-hash in the macro environment, rather than its string name. tests/ChangeLog addition: 2011-04-24 Aidan Kehoe <kehoea@parhasard.net> * automated/lisp-tests.el: Check that distinct symbol macros with identical string names expand to different things.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 24 Apr 2011 09:52:45 +0100
parents d967d96ca043
children f2881cb841b4
line wrap: on
line diff
--- a/tests/automated/lisp-tests.el	Sat Apr 23 22:42:10 2011 +0100
+++ b/tests/automated/lisp-tests.el	Sun Apr 24 09:52:45 2011 +0100
@@ -2914,4 +2914,18 @@
 	"the function special operator doesn't create a lexical context."))
     (Assert (eql 0 (needs-lexical-context 2 nil nil)))))
 
+;; Test symbol-macrolet with symbols with identical string names.
+
+(macrolet
+    ((test-symbol-macrolet ()
+       (let* ((symbol 'my-symbol)
+	      (copy-symbol (copy-symbol symbol))
+	      (third (copy-symbol copy-symbol)))
+	 `(symbol-macrolet ((,symbol [symbol expansion])
+			    (,copy-symbol [copy expansion])
+			    (,third [third expansion]))
+	   (list ,symbol ,copy-symbol ,third)))))
+  (Assert (equal '([symbol expansion] [copy expansion] [third expansion])
+		 (test-symbol-macrolet))))
+
 ;;; end of lisp-tests.el