From: Maxime Devos <maximedevos@telenet.be>
To: Paul Jarc <prj@case.edu>, guile-user@gnu.org
Subject: Re: defining macros within eval
Date: Sun, 16 Oct 2022 18:17:27 +0200 [thread overview]
Message-ID: <3c0dd8aa-97cb-9b31-9e93-44a93ed59a6a@telenet.be> (raw)
In-Reply-To: <ozkdlepgcdl0.fsf@webapps-d-2.tis.cwru.edu>
[-- Attachment #1.1.1: Type: text/plain, Size: 851 bytes --]
On 16-10-2022 11:39, Paul Jarc wrote:
> Hi. I'm updating some old code to work with newer versions of Guile.
> This example used to work with 1.8, but gives an error with 2.2 and
> later:
>
> (begin
> (eval '(define-syntax-rule (rule x) x) (current-module))
> (display (rule "ok\n")))
>
> ERROR: Wrong type to apply: #<syntax-transformer rule> [...]
See my previous reply, and also are you sure that 'eval' is appropriate
here? Would datum->syntax + read tricks work instead?
For an example in the wild, see e.g.
<https://git.gnunet.org/gnunet-scheme.git/tree/gnu/gnunet/message/protocols.scm>.
(the (include-from-path "gnu/.../protocols.scmgen" is not relevant here,
you could inline protocols.scmgen in that example -- I just found
separating it in a separate file a nicer structure).
Greetings,
Maxime.
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]
next prev parent reply other threads:[~2022-10-16 16:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-16 9:39 defining macros within eval Paul Jarc
2022-10-16 14:07 ` Jean Abou Samra
2022-10-16 16:21 ` Maxime Devos
2022-10-16 16:13 ` Maxime Devos
2022-10-16 16:17 ` Maxime Devos [this message]
2022-10-19 8:42 ` Paul Jarc
2022-10-19 17:36 ` Maxime Devos
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=3c0dd8aa-97cb-9b31-9e93-44a93ed59a6a@telenet.be \
--to=maximedevos@telenet.be \
--cc=guile-user@gnu.org \
--cc=prj@case.edu \
/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).