From f54ba65bf212498eff76015ebee0b4ee09c48150 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Thu, 18 Jan 2018 20:58:14 -0800 Subject: [PATCH] Be a little more honest about unsyntaxing macro definitions. --- src/runtime/unsyn.scm | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/runtime/unsyn.scm b/src/runtime/unsyn.scm index e20d8a835..74240e021 100644 --- a/src/runtime/unsyn.scm +++ b/src/runtime/unsyn.scm @@ -172,23 +172,26 @@ USA. (define (unexpand-definition environment name value) (cond ((macro-reference-trap-expression? value) - `(DEFINE-SYNTAX ,name - ,(unsyntax-object - environment - (macro-reference-trap-expression-transformer value)))) + `(define ,name + (make-macro-reference-trap-expression + ,(unsyntax-object + environment + (macro-reference-trap-expression-transformer value))))) ((and (eq? #t unsyntaxer:macroize?) (lambda? value) (not (has-substitution? value))) (lambda-components* value (lambda (lambda-name required optional rest body) (if (eq? lambda-name name) - `(DEFINE (,name . ,(make-lambda-list required optional rest '())) + `(define (,name + . ,(make-lambda-list required optional rest '())) ,@(with-bindings environment value - (lambda (environment*) - (unsyntax-lambda-body environment* body)))) - `(DEFINE ,name ,@(unexpand-binding-value environment value)))))) + (lambda (environment*) + (unsyntax-lambda-body environment* body)))) + `(define ,name + ,@(unexpand-binding-value environment value)))))) (else - `(DEFINE ,name ,@(unexpand-binding-value environment value))))) + `(define ,name ,@(unexpand-binding-value environment value))))) (define (unexpand-binding-value environment value) (if (unassigned-reference-trap? value) -- 2.25.1