guile-devel
[Top][All Lists]
Advanced

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

Re: Enhancement to the syntax system?


From: Stefan Israelsson Tampe
Subject: Re: Enhancement to the syntax system?
Date: Tue, 3 Jul 2012 16:37:14 +0200



On Tue, Jul 3, 2012 at 12:41 AM, Ludovic Courtès <address@hidden> wrote:
Hey!

Stefan Israelsson Tampe <address@hidden> skribis:

> Maybe this help to see what I'm after,
>
> #'(let ((x v)) #.(f #'x))
>
> <=>
>
> (let-syntax ((g (lambda (stx) (syntax-case  stx ((_ x) (f #'x)))))
>    #'(let ((x v)) (g x))

Sorry, I fail to understand the problem you’re trying to solve.

Hmm The #' probably need to be moved to the left of the _expression_ and there might be problems with phases in this analogy but I guess you saw that I wanted to spin the function f on a syntax argument that contained the binding of x done in the let which is not the case If you do a simple #,
 

The above idiom is not frequent to the point that special syntax is
needed, is it?

 
If you want to code your macros like Alex does in ice-9/match.scm then it's not a problem.
If you want to try another path using functions in stead of macros and working hard with #, and #,@
you will for complex macros like a matcher need to gensym by hand or destroy the readability of the
code. As illustrated by the simple example above. It's not that a devastating issue because I have coded quite a lot of CL macros before and can cope with gensymming, but I find it frustrating to know that there probably exists a better way.
 
Thanks,
Ludo’.

/Stefan

reply via email to

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