准引号在语法树 (CL) 中的表示方式

how quasiquotes are represented in syntax tree (CL)

我了解引号在语言中的表示方式:

(equal ''(1 2) (list 'quote (list 1 2))) ;; => T

但是准引号呢?是不是像:

(equal ``(1 2) (list '<???> (list 1 2)))

quasiquotebackquote 而不是 <???> 都不起作用。

Common Lisp 中没有标准表示。 do 应该指定什么反引号,但没有等同于 quote。特别是规范在 2.4.6 中说,在给出反引号应该如何表现的规范之后:

An implementation is free to interpret a backquoted form F1 as any form F2 that, when evaluated, will produce a result that is the same under equal as the result implied by the above definition, provided that the side-effect behavior of the substitute form F2 is also consistent with the description given above.

请注意,这实际上不是问题,因为反引号是您可以自己实现的东西,而 quote 需要在语言中。

一般不需要代理:

 '`(1 2) -> '(1 2)

 '`(,1 2) -> '(1 2)

 '`(,a 2) -> (list* a '(2))

实现可能会扩展为特殊结构,因此反引号表达式也可以打印为反引号表达式。