unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Phil Sainty <psainty@orcon.net.nz>
To: Paul Pogonyshev <pogonyshev@gmail.com>
Cc: 55137@debbugs.gnu.org
Subject: bug#55137: Different result when interpreted and when evaluating byte-compiled code
Date: Wed, 27 Apr 2022 23:20:41 +1200	[thread overview]
Message-ID: <8ddae25aa2488d550ca63e396015002e@webmail.orcon.net.nz> (raw)
In-Reply-To: <CAG7BpaqmWCYjdqDwQYZubgkYQdJH39wuh123+3G1P5oVhb5fJg@mail.gmail.com>

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






  parent reply	other threads:[~2022-04-27 11:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-26 22:16 bug#55137: Different result when interpreted and when evaluating byte-compiled code Paul Pogonyshev
2022-04-27  2:27 ` Eli Zaretskii
2022-04-27  9:19   ` Paul Pogonyshev
2022-04-27 11:20 ` Phil Sainty [this message]
2022-04-27 11:33   ` Paul Pogonyshev
2022-11-08  2:37     ` Michael Heerdegen

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/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8ddae25aa2488d550ca63e396015002e@webmail.orcon.net.nz \
    --to=psainty@orcon.net.nz \
    --cc=55137@debbugs.gnu.org \
    --cc=pogonyshev@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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