我在Common Lisp中遇到了以下错误信息。
在CL中,||代表什么意思?
CL-USER> (write-to-string 5e)
The variable |5E| is unbound.
[Condition of type UNBOUND-VARIABLE]
我在Common Lisp中遇到了以下错误信息。
在CL中,||代表什么意思?
CL-USER> (write-to-string 5e)
The variable |5E| is unbound.
[Condition of type UNBOUND-VARIABLE]
|foo|只是符号的打印表示。 默认情况下,5e不作为数字读取,因此它是一个符号,并且可以打印为| 5E |。人们还可以使用它来在符号中包含各种字符,包括空格。|这是一个符号,不是吗?| - 是的!
CL-USER > (describe '|this is a symbol, isn't it?|)
|this is a symbol, isn't it?| is a SYMBOL
NAME "this is a symbol, isn't it?"
VALUE #<unbound value>
FUNCTION #<unbound function>
PLIST NIL
PACKAGE #<The COMMON-LISP-USER package, 798/1024 internal, 0/4 external>
CL-USER > (parse-integer (symbol-name '5e) :radix 16)
94
它将那些字符用作引号。它试图将5e
解释为变量的名称。我的猜测是您真正希望将其解释为十六进制数,因此应该使用#x5e
。