guile-user
[Top][All Lists]
Advanced

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

perplexing syntax-rules bug


From: Wette, Matthew R (3441)
Subject: perplexing syntax-rules bug
Date: Fri, 19 Dec 2014 20:14:22 +0000
User-agent: Microsoft-MacOutlook/14.4.7.141117

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))





reply via email to

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