Todd
Todd

Reputation: 495

How is a Macro Defined in Terms of Itself?

How can LISP macro's be defined in terms of itself? I saw a similar definition in LISP In Small Pieces. I thought there might be a boot strapping phase where the body gets shoved into syntaxt-environment before define-macro is defined, but I couldn't find it anywhere.

Upvotes: 1

Views: 72

Answers (1)

coredump
coredump

Reputation: 38967

If you use View git blame on this line, you can see the commit that introduced the change. Previously, define-macro was defined in terms of the base language, using set-syntax!.

The commit replaces this definition by a definition that uses that previous value of define-macro, the one which was available from flisp.boot when loading the interpreter.

Upvotes: 2

Related Questions