unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Mark H Weaver <mhw@netris.org>
Cc: guile-devel <guile-devel@gnu.org>
Subject: Re: syntax-local-binding
Date: Mon, 23 Jan 2012 17:05:43 +0100	[thread overview]
Message-ID: <871uqqpfoo.fsf@pobox.com> (raw)
In-Reply-To: <87obtyuj4k.fsf@netris.org> (Mark H. Weaver's message of "Fri, 20 Jan 2012 17:03:23 -0500")

Heya Mark,

On Fri 20 Jan 2012 23:03, Mark H Weaver <mhw@netris.org> writes:

>   (let ((x 1))
>     (syntax-local-binding #'x))
>
> is not equivalent to:
>
>   (let ((x 1))
>     (local-eval '(syntax-local-binding #'x) (the-environment)))

Indeed; bummer!  I think, though, that this is simply a consequence of
giving more power to macro writers.

It is analogous in some ways to the changes that identifier-syntax
introduce into macro writing: with identifier-syntax, one can no longer
write a code walker with syntax-rules pattern matching, as single
identifiers may expand out to complicated expressions, possibly even
with side effects.

>> Why do you think that?  The procedures do carry metadata; I understood
>> that that was your strategy, to use the serialization of the
>> syntax-rules form in the procedure metadata.
>
> Well, this was in the context of a new strategy where psyntax would
> include a new core form called `call-with-current-local-expander' that
> calls its parameter (a procedure or macro) with a procedure that accepts
> an expression and returns an expanded form.  In this case, the most
> straightforward implementation would simply serialize the (r w mod)
> structures directly.
>
> Toward that end, I was thinking it would be nice to keep those
> structures serializable.  The only part that's not currently
> serializable are the transformer procedures for local macros.
> Thus the change in representation.

I have been staring at this empty page here for a little while, writing
and re-writing, but I can't get over a feeling that I really don't want
this kind of work in psyntax itself.  Who knows, maybe you have really
convincing arguments here, but this particular argument should not be
driving a decision about e.g. including syntax-local-binding or not.

That sounds negative, and in a way of course it is -- but still, I'd
much rather enable people to make powerful syntactic abstractions like
local-eval outside psyntax.  Syntax-parse, for example, if it ever
lands, will land in the form of a module

In this case there are lots of strategies you could use.  We could
change psyntax to embed the syntax objects in the procedure meta-data,
like I said.  Ice-9 local-eval could #:replace its own syntax-rules.  We
could (and probably should) do procedure serialization.

Regards,

Andy
-- 
http://wingolog.org/



  parent reply	other threads:[~2012-01-23 16:05 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-15 17:00 syntax-local-binding Andy Wingo
2012-01-15 17:22 ` syntax-local-binding Andy Wingo
2012-01-19 11:41   ` syntax-local-binding Andy Wingo
2012-01-20 20:26     ` syntax-local-binding Mark H Weaver
2012-01-20 21:23       ` syntax-local-binding Andy Wingo
2012-01-20 22:03         ` syntax-local-binding Mark H Weaver
2012-01-22  0:03           ` syntax-local-binding Ludovic Courtès
2012-01-23 16:05           ` Andy Wingo [this message]
2012-01-23 21:03             ` syntax-local-binding Mark H Weaver
2012-01-23 22:19               ` syntax-local-binding Andy Wingo
2012-01-24  2:11                 ` syntax-local-binding Mark H Weaver
2012-01-24 11:42                   ` syntax-local-binding Andy Wingo
2012-01-24 17:29                     ` syntax-local-binding Noah Lavine
2012-01-24 10:30                 ` syntax-local-binding Peter TB Brett
2012-01-24 10:38                   ` syntax-local-binding David Kastrup
2012-01-24 11:26                   ` syntax-local-binding Andy Wingo
2012-01-24 13:25                     ` syntax-local-binding Mark H Weaver
2012-01-24 20:28                       ` mark uniqueness (Was: Re: syntax-local-binding) Andy Wingo
2012-01-25  0:26                         ` mark uniqueness Mark H Weaver
2012-01-25  9:02                           ` Andy Wingo
2012-01-24 21:22                       ` syntax-local-binding Andy Wingo
2012-01-25  2:30                         ` syntax-local-binding Mark H Weaver
2012-01-25  7:49                           ` syntax-local-binding Stefan Israelsson Tampe
2012-01-25 11:18                           ` syntax-local-binding Andy Wingo
2012-01-25 13:18                           ` syntax-local-binding Ludovic Courtès
2012-01-25 18:08                             ` syntax-local-binding Mark H Weaver
2012-01-26 11:21                             ` syntax-local-binding Andy Wingo

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=871uqqpfoo.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=guile-devel@gnu.org \
    --cc=mhw@netris.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).