|
From: | Panicz Maciej Godek |
Subject: | Re: perplexing syntax-rules bug |
Date: | Sat, 20 Dec 2014 00:11:45 +0100 |
(define-syntax sect
(syntax-rules ()
((sect <name> <expr> ...)
(let* ((sval* '(skip ((name . <name>) (title . #f))))
(sval (cdr sval*)))
(format #t "new sect: ~a\n" (quote <name>))
(format #t " sval= ~a\n\n" sval)
(assq-set! sval 'title "ABC")
(values)))))
Sorry to bug, I can't figure out why "sval" in the second evaluation of "sect" is bound to the "sval" from the first evaluation of "sect". Anyone understand? This is guile 2.0.11. -- Matt
;; bug_syntax.scm
(define-syntax sect
(syntax-rules ()
((sect <name> <expr> ...)
(let ((sval '((name . <name>) (title . #f))))
(format #t "new sect: ~a\n" (quote <name>))
(format #t " sval= ~a\n\n" sval)
(assq-set! sval 'title "ABC")
(values)))))
(sect one (title "Section One"))
(sect two (title "Section Two"))
> (load "bug_syntax.scm")
new sect: one
sval= ((name . one) (title . #f))
new sect: two
sval= ((name . two) (title . ABC))
[Prev in Thread] | Current Thread | [Next in Thread] |