unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Lynn Winebarger <owinebar@free-expression.org>
Subject: Re: syntax-case
Date: Mon, 19 Aug 2002 10:22:08 -0500	[thread overview]
Message-ID: <0208191022080A.19624@locke.free-expression.org> (raw)
In-Reply-To: <02081909573609.19624@locke.free-expression.org>

On Monday 19 August 2002 09:57, Lynn Winebarger wrote:
>     Does anyone else see the following behaviour (from a Petite Chez
> session) as inconsistent?
>      I was trying to figure out how you can eagerly expand macros without
> worrying about this sort of thing, and  
       this sort of thing means the dependence of a macro expansion on a
variable binding that could change.  And apparently, plain lexical variable
bindings are not in scope in a let(rec)-syntax, but global variable bindings
are.  The last email didn't include an example of the global binding working
in a let-syntax (just in define-syntax), so here's one (again from Chez):

> (define x 5)
> (let-syntax ((foo (lambda (exp)
			(syntax-case exp ()
			  ((_ y) (with-syntax ((z (datum->syntax-object (syntax _) x)))
				   (syntax (quote (z y)))))))))
      (foo 'bar))
(5 'bar)
>

      I had thought this behaviour was part of syntax-case, but now I see it's actually part
of let(rec)-syntax.  If the lexical variables were in scope in a let(rec)-syntax, macros
would have to be re-expanded every time an expression that contained them got
executed.  I'm not sure why the same criticism doesn't hold for global variable bindings,
though.

Lynn


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


      reply	other threads:[~2002-08-19 15:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-19 14:57 syntax-case Lynn Winebarger
2002-08-19 15:22 ` Lynn Winebarger [this message]

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=0208191022080A.19624@locke.free-expression.org \
    --to=owinebar@free-expression.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).