unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Phil <theseaisinhere@gmail.com>
To: Andy Wingo <wingo@pobox.com>
Cc: Michael Lucy <MichaelGLucy@gmail.com>, guile-devel@gnu.org
Subject: Re: PEG Parser Updates/Questions
Date: Sun, 29 Aug 2010 02:45:19 -0500	[thread overview]
Message-ID: <AANLkTim-ihMKThRgVo8bpV9YxxjyBh08D6L9=fEPzgp8@mail.gmail.com> (raw)
In-Reply-To: <m38w41rmzn.fsf@unquote.localdomain>

So is there a sort of ETA on when this will be part of Guile?

On Fri, Aug 20, 2010 at 4:30 PM, Andy Wingo <wingo@pobox.com> wrote:
> Hello, Mr. Lucy!
>
> At some point I might escape the need to apologize at every mail I send,
> but until then: sorry for the late response!
>
> On Thu 05 Aug 2010 23:40, Michael Lucy <MichaelGLucy@Gmail.com> writes:
>
>> On Wed, Jul 28, 2010 at 12:13 AM, Michael Lucy <MichaelGLucy@gmail.com> wrote:
>>> I've officially eliminated the last define-macro expression.
>>>
>>> However, I get the feeling that things may not be exactly as desired.
>>> The original program made extensive use of functions in building the
>>> macros, and I originally tried to replace these with macros.  This
>>> turned out to be a little difficult to debug, however (read: I was
>>> unable to make the code actually work).  I eventually abandoned this
>>> and just made datum->syntax calls.
>
> I'll have to check and see what the deal is. However note that with
> procedural macros you can still use helper functions that operate on
> syntax objects, destructing them via syntax and building up syntax
> objects using `syntax'. Think of a procedural macro as consisting of one
> helper function :)
>
>>> The downside is that one doesn't get all the same benefits of
>>> referential transparency, so I still have gensyms in the functions
>>> etc.  Is this a problem?
>
> Yep! But it probably won't be a big deal to fix.
>
>>> Another question about module namespaces:  I have some syntax that I'd
>>> like to be available to code generated by macros in my module, but
>>> which I'd rather not export to the user (to avoid clobbering their
>>> functions).  Is there a standard way of doing this?
>
> Phil mentioned @ and @@, but the normal case is that things Just Work,
> due to the referential-transparency-preserving properties of
> syntax-case.
>
> For example:
>
>    (define-module (a)
>      #:export (b))
>
>    (define-syntax b
>      (lambda (x)
>        (syntax-case x ()
>          ((_ exp)
>           #'(c exp)))))
>
>    (define-syntax c
>      (syntax-rules ()
>        ((_ exp) (car exp))))
>
>    (define-module (d)
>      #:use-module (a))
>
>    (b '(1 2 3))
>     => 1
>
> You see that the expansion of `(b '(1 2 3))' in the module `(d)'
> produced a reference to `c' -- but `c' is private in the `(a)'
> module. Barring the use of datum->syntax, syntax-case macros *scope free
> identifiers within the lexical conext and module in which they
> appear*. That's what "hygiene" is.
>
> Anyway, I hope to have time to poke this next week. I'm very much
> looking forward to having a good PEG parser!
>
> Cheers,
>
> Andy
> --
> http://wingolog.org/
>
>



  reply	other threads:[~2010-08-29  7:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-28  5:13 PEG Parser Updates/Questions Michael Lucy
2010-07-28  5:41 ` No Itisnt
2010-07-28  5:51   ` Michael Lucy
2010-08-06  6:40 ` Michael Lucy
2010-08-16  5:37   ` Michael Lucy
2010-08-20 21:30   ` Andy Wingo
2010-08-29  7:45     ` Phil [this message]
2010-08-30 15:32       ` 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='AANLkTim-ihMKThRgVo8bpV9YxxjyBh08D6L9=fEPzgp8@mail.gmail.com' \
    --to=theseaisinhere@gmail.com \
    --cc=MichaelGLucy@gmail.com \
    --cc=guile-devel@gnu.org \
    --cc=wingo@pobox.com \
    /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).