3 ms·
It usually is a tree, just not a syntax tree. For example, the "if" special form in CL has the syntax: (IF <text-expr> <then-expr> [<else-expr>]) But appea
by aidenn0 3y ago
It usually is a tree, just not a syntax tree. For example, the "if" special form in CL has the syntax:
(IF <text-expr> <then-expr> [<else-expr>])
But appearing in a macro expansion, it would just be a list where the first item was the symbol "IF" from the "COMMON-LISP" package. In addition, you could put e.g.
(IF foo bar baz biff quux)
Inside the body of a macro you would get a list that does not match the syntax of the "if" special form, despite superficially looking like such a list. This doesn't match anything that one would call an "AST" in other languages, which would enforce syntactical correctness of special forms.