unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Noam Postavsky <npostavs@gmail.com>
Cc: "Omar Antolín Camarena" <omar@matem.unam.mx>, 40827@debbugs.gnu.org
Subject: bug#40827: 28.0.50; Macroexpansion at runtime
Date: Sat, 25 Apr 2020 16:04:49 -0400	[thread overview]
Message-ID: <jwvzhazl4kw.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87sggrfwo0.fsf@gmail.com> (Noam Postavsky's message of "Sat, 25 Apr 2020 10:49:03 -0400")

>>> Occasionally problems result from the fact that a macro call is
>>> expanded each time it is evaluated in an interpreted function, but is
>>> expanded only once (during compilation) for a compiled function. If
>>> the macro definition has side effects, they will work differently
>>> depending on how many times the macro is expanded.

We could be more nuanced, indeed, since the "expanded once" can also
happen for interpreted code (and the "expand many times" can also happen
in code that's in a compiled file, if that code happened to be "hidden"
from the compiler, such as hidden within a `quote`).

But the basic idea remains the same: macro expansion may happen only
once as part of the preprocessing, or it may be performed anew each time
the code is run (or anything in-between, really), so the code should not
make assumptions about when macros are expanded or how many times
they're expanded.


        Stefan






  reply	other threads:[~2020-04-25 20:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-24 19:09 bug#40827: 28.0.50; Macroexpansion at runtime Omar Antolín Camarena
2020-04-25 14:49 ` Noam Postavsky
2020-04-25 20:04   ` Stefan Monnier [this message]
2021-08-10 16:05     ` Lars Ingebrigtsen
2020-04-26  3:28   ` Richard Stallman

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=jwvzhazl4kw.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=40827@debbugs.gnu.org \
    --cc=npostavs@gmail.com \
    --cc=omar@matem.unam.mx \
    /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).