unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Stefan Israelsson Tampe <stefan.itampe@gmail.com>
To: guile-devel <guile-devel@gnu.org>
Subject: Re: syntax-local-value patch for discussion
Date: Thu, 19 Jan 2012 10:50:47 +0100	[thread overview]
Message-ID: <CAGua6m2xcNknBMKJUL6ivM5E5sgVJJo-89tDDRe10fGKEbLAsQ@mail.gmail.com> (raw)
In-Reply-To: <CAGua6m1EaQWF1_EJe6JJzwsj7k_28wvViXh3foBGZLeL_RyxUQ@mail.gmail.com>

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

Hi,

Working on porting syntax-parse is a learning experience and I know
understand how it uses
syntax-local-value as a way to lookup a syntax object by joining the wraps
together with the
total wrap at the macro call.

The question is if this really are the total wrap e.g. contains the history
of all the previous variable
and macro and syntax definitions. Is this so or are it a partial part of
the history?

Anyway syntax-parse works by defining pattern variables the hard core way
and I have now changed that
to a more standard way of implementation leading to skipping
syntax-local-value (variables are stored in
a struct and they does then not contain the correct wrap) but instead
examine the syntax variables used
and transport the wraps of the containing syntax variable of the struct.
For this I have a messy and sloppy
algorithm just to make it work - but I would like to have a syntax-join
function that takes two syntax objects
and join them correctly and robustly in the pressense of eventual marks or
not.

Anyway this now works,

(define-syntax-class t (pattern (x:id y)))
(define-syntax a (lambda (x) (syntax-parse x ((_ z:t ...) #'(+ z.y ...)))))
(a (x1 1) (x2 2) (x3 3))
$1 = 6

/Stefan

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

  reply	other threads:[~2012-01-19  9:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-05 18:12 syntax-local-value patch for discussion Stefan Israelsson Tampe
2011-12-08 21:58 ` Ian Price
2011-12-09 11:49   ` Stefan Israelsson Tampe
2012-01-07  0:05 ` Andy Wingo
2012-01-08 17:47   ` Stefan Israelsson Tampe
2012-01-08 19:15 ` Mark H Weaver
2012-01-08 21:28   ` Stefan Israelsson Tampe
2012-01-14 16:42   ` Stefan Israelsson Tampe
2012-01-19  9:50     ` Stefan Israelsson Tampe [this message]
2012-01-23 10:53       ` Andy Wingo
2012-01-23 16:06         ` Stefan Israelsson Tampe
2012-01-26 11:31           ` Andy Wingo
2012-01-26 15:49             ` Stefan Israelsson Tampe

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=CAGua6m2xcNknBMKJUL6ivM5E5sgVJJo-89tDDRe10fGKEbLAsQ@mail.gmail.com \
    --to=stefan.itampe@gmail.com \
    --cc=guile-devel@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).