为什么 "Let "要加一个新行?(我可以把它去掉吗?)

问题描述 投票:0回答:1

在我的shell中,我尝试了一些东西,并注意到在我的 "Let "开头添加了新行。let 语句。

[86]> (setf A 5)
5
[87]> (let () (print 'hello) (print 'there) A )
       ;; this blank line right here
HELLO
THERE
5

有没有一个was来删除多余的换行?

lisp common-lisp clisp
1个回答
7
投票

这不是 let 这就是添加新行------这是 print.

根据 中英双语学校: "print和prin1一样,只是打印出来的对象的表示方式是 前面加一个新行 并在后面加一个空格。"

可以 使用 prin1 而不是。

CL-USER> (let () (prin1 'hello) (print 'there) 5)
HELLO
THERE 
5

或者你可以用 format

CL-USER> (let () (format t "~a~%~a~%" 'hello 'there) 5)
HELLO
THERE
5
© www.soinside.com 2019 - 2024. All rights reserved.