From 7bfdddc49b7d58963863679af766430b1692bfe7 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Fri, 14 Apr 2017 17:17:45 +0200 Subject: [PATCH 2/2] 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. --- expand.scm | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/expand.scm b/expand.scm index b71a4de..3a6b436 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)) -- 2.1.4