Thank you for giving my approach a kind of “trial by fire”.
Considering what you wrote, I still believe in my datum->syntax
approach in my special case. After all, datum->syntax exists for a
reason, I suppose. I am interested in your further comments. They
have been very helpful.
On Wed, Sep 04
Hello again,
I wrote earlier:
> So, instead of using 'match' on the result of 'syntax->datum', you
> should instead use 'syntax-case' on the syntax object itself, like this
> (untested):
>
> (let loop ((e #'exp))
> (syntax-case e ()
> (num
>(number? (syntax->datum #'num))
>
Hi Florian,
"pelzflorian (Florian Pelz)" writes:
> To retain unhygienic references, I am now using datum->syntax instead
> of local-eval. It is much better. For example, to make a macro that
> increments all numbers in a given program by one:
>
> (use-modules (ice-9 match))
> (define-syntax on
On Thu, Aug 29, 2019 at 07:04:07PM -0400, Mark H Weaver wrote:
> Hi Florian,
>
> "pelzflorian (Florian Pelz)" writes:
>
> > I am writing a Guile macro to manipulate Scheme code and am stuck on
> > what I hope is a simple problem and it would be nice if you could
> > explain. I try:
> >
> > (def
On Thu, Aug 29, 2019 at 07:04:07PM -0400, Mark H Weaver wrote:
> This approach is misguided and unnecessary. You don't need to include
> 'use-modules' in your macro expansion, and it's best avoided.
>
:) I suspected I was doing something very wrong.
> FYI, the way this works internally is tha
Hi Florian,
"pelzflorian (Florian Pelz)" writes:
> I am writing a Guile macro to manipulate Scheme code and am stuck on
> what I hope is a simple problem and it would be nice if you could
> explain. I try:
>
> (define-syntax O
> (lambda (x)
> (syntax-case x ()
> ((_)
>#`(beg
Hello,
I am writing a Guile macro to manipulate Scheme code and am stuck on
what I hope is a simple problem and it would be nice if you could
explain. I try:
(define-syntax O
(lambda (x)
(syntax-case x ()
((_)
#`(begin (use-modules (ice-9 local-eval))
(local-ev