在我的 shell 中,我正在尝试一些东西,并注意到并在我的let语句开头添加了换行符。
[86]> (setf A 5)
5
[87]> (let () (print 'hello) (print 'there) A )
;; this blank line right here
HELLO
THERE
5
Run Code Online (Sandbox Code Playgroud)
有没有删除额外的换行符?
这不是let添加换行符 --- 它是print.
根据CLHS:“print 就像 prin1,只是对象的打印表示前面是换行符,后面是空格。”
您可以使用prin1,而不是:
CL-USER> (let () (prin1 'hello) (print 'there) 5)
HELLO
THERE
5
Run Code Online (Sandbox Code Playgroud)
或者你可以使用 format
CL-USER> (let () (format t "~a~%~a~%" 'hello 'there) 5)
HELLO
THERE
5
Run Code Online (Sandbox Code Playgroud)