[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: none

From: Troy Hinckley
Subject: Re: none
Date: Fri, 30 Jul 2021 23:09:29 -0600

byte-run.el does use backquotes


However I had not thought about the impacts of lazy evaluation. I guess this would require that you load the code twice: First with the interpreter, then with the byte compiler, since you can't compile a macro that has not been defined.

On Fri, Jul 30, 2021 at 3:33 PM Stefan Monnier <monnier@iro.umontreal.ca> wrote:
Troy Hinckley [2021-07-27 17:54:25] wrote:
> Subject: Load order for elisp files
> User-agent: mu4e 1.2.0; emacs 28.0.50
> I am trying to better understand the bootstrap process for Emacs and I
> have run into a chicken and egg problem. When looking for where the
> basic functions are defined, I can see that defmacro and defun are defined in
> byte-run.el. However the code needed to evaluate a macro is in
> backquote.el.

Hmm... no, the code in `backquote.el` is only used to macro expand uses
of backquotes (which are commonly used in macro definitions but not in
all of them) and `byte-run.el` is indeed careful not to use backquotes,
specifically because that would break the bootstrap.

IIRC there are cases where we rely on even more subtle details, more
specifically, I seem to remember that we have functions whose body uses
macros that aren't yet defined when we define the function, and this
still works OK because this is done at a stage where macro expansion is
still lazy, so the macros in the body of the function are only expanded
when the function gets called (or when it gets byte-compiled) both of
which "happen" to take place later, when the corresponding macros have
been defined.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]