unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: "Wette, Matthew R (3441)" <matthew.r.wette@jpl.nasa.gov>
To: "guile-user@gnu.org" <guile-user@gnu.org>
Subject: perplexing syntax-rules bug
Date: Fri, 19 Dec 2014 20:14:22 +0000	[thread overview]
Message-ID: <D0B9C71A.F152%Matthew.R.Wette@jpl.nasa.gov> (raw)

[-- Attachment #1: Type: text/plain, Size: 747 bytes --]

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




[-- Attachment #2: Type: text/html, Size: 2789 bytes --]

             reply	other threads:[~2014-12-19 20:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-19 20:14 Wette, Matthew R (3441) [this message]
2014-12-19 23:11 ` perplexing syntax-rules bug Panicz Maciej Godek
2014-12-20  7:39 ` Marco Maggi
2014-12-20 10:29   ` Thien-Thi Nguyen
2014-12-20 14:37   ` Wette, Matthew R (3441)
2014-12-20 15:02     ` Wette, Matthew R (3441)
2014-12-20 15:02   ` Panicz Maciej Godek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D0B9C71A.F152%Matthew.R.Wette@jpl.nasa.gov \
    --to=matthew.r.wette@jpl.nasa.gov \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).