~ chicken-core (chicken-5) a959524b84c44bfb675fb6933350ccddbdfc0f11


commit a959524b84c44bfb675fb6933350ccddbdfc0f11
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:21:20 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 b71a4de2..3a6b4364 100644
--- a/expand.scm
+++ b/expand.scm
@@ -845,18 +845,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