From: "Dr. Arne Babenhauserheide" <arne_bab@web.de>
To: "Linus Björnstam" <linus.internet@fastmail.se>
Cc: Guile User Mailing List <guile-user@gnu.org>
Subject: Re: Syntax-Case macro that selects the N-th element from a list
Date: Mon, 05 Apr 2021 18:24:40 +0200 [thread overview]
Message-ID: <87y2dw4s3b.fsf@web.de> (raw)
In-Reply-To: <8e6a1a19-c857-44c2-b5ea-3801f9366677@www.fastmail.com>
[-- Attachment #1: Type: text/plain, Size: 1000 bytes --]
Hi Linus,
thank you for your tipps!
Linus Björnstam writes:
> Can you use the procedural part of syntax-rules? You have the power of
> using scheme at expansion time, which means you could do list-ref all
> you want.
>
> That "syntax-rules" is of course syntax-case.
>
> The only thing is that guile lacks syntax->list, so sometimes you have
> to manually turn it into a list. Say you are matching ((_ stuff ...)
> Body) stuff is a syntax object. You could turn it into a list of syntax
> objects by doing #'(stuff ...). Then you can treat it as a regular
> list, and use quasisyntax to put it back into your output syntax.
…
> Try writing it first with unhygienic macros and get that working
> before porting to syntax-case if you don't know the ins-and-outs of
> syntax-case.
I have not yet written an unhygienic macro in Guile.
Do I use the internal macros for that?
Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein
ohne es zu merken
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1125 bytes --]
next prev parent reply other threads:[~2021-04-05 16:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-05 11:30 Syntax-Case macro that selects the N-th element from a list Dr. Arne Babenhauserheide
2021-04-05 12:21 ` Linus Björnstam
2021-04-05 13:40 ` Linus Björnstam
2021-04-05 16:24 ` Dr. Arne Babenhauserheide [this message]
2021-04-05 13:51 ` Tim Van den Langenbergh
2021-04-05 15:08 ` Taylan Kammer
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=87y2dw4s3b.fsf@web.de \
--to=arne_bab@web.de \
--cc=guile-user@gnu.org \
--cc=linus.internet@fastmail.se \
/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).