Re:Why Lisp macros are cool, a Perl perspective (2005)
by lispm on Monday December 16, 2019 @09:24PM
(#21809903)
The code gets compiled (and macro expanded), before it is running. That's a definition of compile-time in Lisp.
In an interpreter version of Lisp, the interpreter may expand the macros at runtime.
When running in the REPL (the most common way to interface with Lisp) the compile time and runtime Lisps are the same.
For example, here's a copy/paste from a REPL session that defines a macro that defines a function. The macro (at "compile time") prints information about the function (just its argument count) to stdout before using defun (itself a macro) to actually define the function.
Next I call the new function and print out a disassembly, just to show the function is in fact compiled
"CL-USER> " is the prompt in the REPL I use:
It is also possible to compile a Lisp program to an executable (or byte code or whatever) and run it, and not use the dynamic aspect of it.