From bc58c0b635e71ec649255c0ad6fbfd0f266c838d 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 55e3107..9e73e09 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)) -- 2.1.4