common-lisp引用和自求值对象
示例
请注意,许多数据类型不需要引用,因为它们自己求值。QUOTE对符号和列表特别有用,可防止以Lisp形式进行求值。
不需要引用其他数据类型以防止求值的示例:字符串,数字,字符,CLOS对象,...
这是一个字符串示例。评估结果是字符串,无论它们是否在源中被引用。
> (let ((some-string-1 "this is a string") (some-string-2 '"this is a string with a quote in the source") (some-string-3 (quote "this is another string with a quote in the source"))) (list some-string-1 some-string-2 some-string-3)) ("this is a string" "this is a string with a quote in the source" "this is another string with a quote in the source")
因此,为对象报价是可选的。