GNU bug report logs - #55137
Different result when interpreted and when evaluating byte-compiled code

Previous Next

Package: emacs;

Reported by: Paul Pogonyshev <pogonyshev <at> gmail.com>

Date: Tue, 26 Apr 2022 22:18:01 UTC

Severity: normal

Full log


Message #14 received at 55137 <at> debbugs.gnu.org (full text, mbox):

From: Phil Sainty <psainty <at> orcon.net.nz>
To: Paul Pogonyshev <pogonyshev <at> gmail.com>
Cc: 55137 <at> debbugs.gnu.org
Subject: Re: bug#55137: Different result when interpreted and when
 evaluating byte-compiled code
Date: Wed, 27 Apr 2022 23:20:41 +1200
On 2022-04-27 10:16, Paul Pogonyshev wrote:
>     (defmacro is-special-as-macro ()
>       (special-variable-p 'special-variable))

This macro does not expand to code which calls `special-variable-p'.
Rather it calls `special-variable-p' at expansion time, and expands
to the return value of that call (nil or t).

If you byte-compile your code without loading it, then your would-be
`special-variable' doesn't exist, and hence your macro was expanding
to nil rather than t.

Try this:

     (defmacro is-special-as-macro ()
       '(special-variable-p 'special-variable))


-Phil





This bug report was last modified 2 years and 275 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.