guile-user
[Top][All Lists]
Advanced

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

defining macros within eval


From: Paul Jarc
Subject: defining macros within eval
Date: Sun, 16 Oct 2022 05:39:07 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

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.



reply via email to

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