mit-scheme-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

dropped syntactic closure in 10.90


From: Arthur A. Gleckler
Subject: dropped syntactic closure in 10.90
Date: Tue, 4 Feb 2020 22:40:23 -0800

I've been trying to debug a macro that worked under 9.2.1 but fails under 10.90 (76bb84eaa).  I've narrowed the problem down to the following reproducible test case:

(define-syntax bar
  (sc-macro-transformer
   (lambda (exp env)
     (let ((bindings (let ((sc (close-syntax (cadr exp) env)))
                       (list sc sc))))
       `(let* (,bindings)
         'x)))))

(define-syntax bat
  (syntax-rules ()
    ((_ body ...)
     (let ((md 'quux))
       (bar md)))))

;; Under 9.2.1:

;; 1 ]=> (pp (lambda () (bat x)))
;; (lambda ()
;;   (let ((md 'quux))
;;     (let ((md md))
;;       'x)))
;; ;Unspecified return value
;;
;; 1 ]=>

;; Under 10.90 (76bb84eaa):

;; 1 ]=> (pp (lambda () (bat x)))
;; (lambda ()
;;   (let ((.md.1-0 'quux))
;;     (let ((.md.2-1 md))
;;       'x)))
;; ;Unspecified return value
;;
;; 1 ]=>


Note that the expansion under 10.90 means that (bat x) will fail because the variable md will be unbound.

Is this a bug in macro expansion in 10.90, or was there a bug in 9.2.1 that caused my macro to work there?  Or am I hopelessly confused?

Thanks.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]