~ chicken-core (chicken-5) 41d48cdba2e46645c7dd157525652aa3953aed6c


commit 41d48cdba2e46645c7dd157525652aa3953aed6c
Author:     Peter Bex <peter@more-magic.net>
AuthorDate: Fri Apr 14 17:17:45 2017 +0200
Commit:     Evan Hanson <evhan@foldling.org>
CommitDate: Wed Apr 19 11:20:37 2017 +1200

    Remove unnecessary double alias for already aliased renamed identifiers.
    
    This was an overly complicated solution for #518, which was only
    necessary because of the bogus "lookup" call when renaming.  Now that
    we don't undo a macro-alias on renaming anymore, but only look up
    already-renamed identifiers in the syntax env, this case is no longer
    triggered, so we fall back to the "else" clause, which will cause the
    symbol to be aliased normally.
    
    All the sample code snippets from that ticket behave identically with
    and without this patch.
    
    Signed-off-by: Evan Hanson <evhan@foldling.org>

diff --git a/expand.scm b/expand.scm
index 55e3107e..9e73e09f 100644
--- a/expand.scm
+++ b/expand.scm
@@ -816,18 +816,9 @@
 	       ((assq sym se) =>
 		(lambda (a)
 		  (cond ((symbol? a)
-			 ;; Add an extra level of indirection for already aliased
-			 ;; symbols.  This prevents aliased symbols from popping up
-			 ;; in syntax-stripped output.
-			 (cond ((or (getp a '##core#aliased)
-				    (getp a '##core#primitive))
-				(let ((a2 (macro-alias sym se)))
-				  (dd `(RENAME/SE/ALIASED: ,sym --> ,a ==> ,a2))
-				  (set! renv (cons (cons sym a2) renv))
-				  a2))
-			       (else (dd `(RENAME/SE: ,sym --> ,a))
-				     (set! renv (cons (cons sym a) renv))
-				     a)))
+			 (dd `(RENAME/SE: ,sym --> ,a))
+			 (set! renv (cons (cons sym a) renv))
+			 a)
 			(else
 			 (let ((a2 (macro-alias sym se)))
 			   (dd `(RENAME/SE/MACRO: ,sym --> ,a2))
Trap