USE-VALUE :R1 Input a value to be used instead of N.
STORE-VALUE :R2 Input a new value for N.
[32]> (setf x (list 'a 'b 'c))
(A B C)
[33]> (x)
*** - EVAL: undefined function X
The following restarts are available:
USE-VALUE :R1 Input a value to be used instead of (FDEFINITION 'X).
RETRY :R2 Retry
STORE-VALUE :R3 Input a new value for (FDEFINITION 'X).
ABORT :R4 Abort main loop
Break 1 [34]> :R3
New (FDEFINITION 'X)> R:3
*** - READ from #<IO SYNONYM-STREAM *TERMINAL-IO*>: there is no package with name "R"
The following restarts are available:
ABORT :R1 Abort debug loop
ABORT :R2 Abort main loop
Break 2 [35]> :R2
[36]> 'x
X
[37]> (con
concatenate cond conjugate consp constantp convert-attributes convert-string-from-bytes
concatenated-stream-streams confstr cons constantly continue convert-mode convert-string-to-bytes
[37]> (con
concatenate cond conjugate consp constantp convert-attributes convert-string-from-bytes
concatenated-stream-streams confstr cons constantly continue convert-mode convert-string-to-bytes
[37]> (cond x)
*** - COND: clause X should be a list
The following restarts are available:
ABORT :R1 Abort main loop
Break 1 [38]> :R2
:R2
Break 1 [38]> :R1
[39]> (cond 'x)
*** - COND: variable QUOTE has no value
The following restarts are available:
USE-VALUE :R1 Input a value to be used instead of QUOTE.
STORE-VALUE :R2 Input a new value for QUOTE.
ABORT :R3 Abort main loop
Break 1 [40]> :R3
[41]> (car x)
A
[42]> (setf (car x) 'n)
N
[43]> x
(N B C)
[44]>
总结:你可以仅仅通过赋值来隐式地创建全局变量,在源文件里使用显式的defparameters是更好的风格。你不仅仅可以赋值给一个变量。setf的第一个参数可以是一个表达式。这种情况下,第二个参数的值将会被插入到第一个参数所引用的位置。