all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Thuna <thuna.cing@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: `eval'ing form in the current lexical environment
Date: Sun, 07 Jul 2024 22:49:41 -0400	[thread overview]
Message-ID: <jwvbk3861rz.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87y16c3acc.fsf@gmail.com> (Thuna's message of "Mon, 08 Jul 2024 04:07:31 +0200")

> All macros are expanded and processed, thus `(,head ,@args) above is
> /necessarily/ a function call... that is, unless it is later redefined
> as a macro.

I think this is the part I don't understand: why do you worry about
`head` being a function (or undefined) during macro-expansion but
a macro at run-time?

If the code is compiled, such a change leads to an error and we blame
the change, not the compiler.

E.g. M-: (disassemble '(lambda () (foobar 5))) RET
turns into the byte-code:

     byte code:
       args: nil
     0       constant  foobar
     1       constant  5
     2       call      1
     3       return

and this `call` just signals an error if `foobar` is not a function at
run-time.

So, I think what I'm saying is that you should probably not try to
handle this case at all.


        Stefan




  reply	other threads:[~2024-07-08  2:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-07 18:55 `eval'ing form in the current lexical environment Thuna
2024-07-07 19:16 ` Stefan Monnier via Users list for the GNU Emacs text editor
2024-07-08  2:07   ` Thuna
2024-07-08  2:49     ` Stefan Monnier [this message]
2024-07-08 21:38       ` Thuna
2024-07-08 22:03         ` Stefan Monnier
2024-07-08 22:42           ` Thuna

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

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

  git send-email \
    --in-reply-to=jwvbk3861rz.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=help-gnu-emacs@gnu.org \
    --cc=thuna.cing@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.