为什么可以引用 KEYWORD 包中以前未定义的变量?

Why is it possible to refer to a previously undefined variable in the KEYWORD package?

引用之前未定义的变量将导致错误:The variable X is unbound(SBCL 的错误消息)。但是,引用 KEYWORD 包中先前未定义的变量不会导致任何错误。例如,KEYWORD:XYZ 神奇地具有 :XYZ 的值,即使用户之前没有定义和导出该变量。为什么会这样?怎么可能即时自动创建一个变量?

Lisp reader 实习生以 package marker in the KEYWORD package; the package marker is a colon by default. Symbols interned in the KEYWORD package are automatically made external. From 11.1.2.3.1 of the HyperSpec:

开头的符号

The KEYWORD package is treated differently than other packages in that special actions are taken when a symbol is interned in it. In particular, when a symbol is interned in the KEYWORD package, it is automatically made to be an external symbol and is automatically made to be a constant variable with itself as a value.