[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to use-modules within macro?
From: |
pelzflorian (Florian Pelz) |
Subject: |
How to use-modules within macro? |
Date: |
Thu, 29 Aug 2019 16:41:44 +0200 |
User-agent: |
NeoMutt/20180716 |
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-eval 42 (the-environment)))))))
(pk (O))
But it does not work; it cannot resolve local-eval and
the-environment. Why? When I write it in the interpreter, a second
call to (pk (O)) works and prints 42.
Using (@ (ice-9 local-eval) …) does not work for looking up
the-environment.
Regards,
Florian
- How to use-modules within macro?,
pelzflorian (Florian Pelz) <=