guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Syntax-Case macro that selects the N-th element from a list


From: Dr. Arne Babenhauserheide
Subject: Re: Syntax-Case macro that selects the N-th element from a list
Date: Mon, 05 Apr 2021 18:24:40 +0200
User-agent: mu4e 1.4.15; emacs 27.2

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: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]