unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* defining macros within eval
@ 2022-10-16  9:39 Paul Jarc
  2022-10-16 14:07 ` Jean Abou Samra
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Paul Jarc @ 2022-10-16  9:39 UTC (permalink / raw)
  To: guile-user

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>

The error happens for define-syntax-rule and define-macro, but not
plain define.  It happens when eval is within begin or let, but not at
the top level.  Is there some way to make this work?  In my real code,
the expression is read from a file, where it might be a macro
definition or anything else, and it's evaluated in a different module
from the current one.



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-10-19 17:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2022-10-19  8:42   ` Paul Jarc
2022-10-19 17:36     ` Maxime Devos

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).