GNU bug report logs -
#41381
28.0.50; Can't compile file containing a local pcase macro
Previous Next
Reported by: Philipp Stephani <p.stephani2 <at> gmail.com>
Date: Mon, 18 May 2020 21:24:02 UTC
Severity: normal
Found in version 28.0.50
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Philipp Stephani <p.stephani2 <at> gmail.com> writes:
> $ cat test.el
> ;;; -*- lexical-binding: t; -*-
> (pcase-defmacro test () '_)
> (defun test () (pcase nil ((test))))
>
> $ emacs -Q -batch -l bytecomp -f batch-byte-compile test.el
>
> In toplevel form:
> test.el:3:1: Error: Symbol’s function definition is void: test--pcase-macroexpander
>
> It works if the pcase macro is surrounded with `eval-when-compile', but
> that shouldn't be necessary I think.
Wouldn't it be better to surround the pcase-defmacro call with
(eval-and-compile ...)?
I think it would be great if there were some clever way to make eager
macro expansion less eager, so things like evaluating the following two
expressions one after another
(defmacro foo () 3)
(progn
(defmacro foo () 4)
(foo))
would produce the right result (4 rather than 3). That would solve this
problem as well, but it's probably impossible to do with reasonable
performance.
This bug report was last modified 3 years and 296 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.