在格式函数中使用列表的元素

rho*_*ron 2 lisp clisp common-lisp

我想做的事情如下:

(setf list '(1 2 3 4 5 6))
(format t "~A some text here ~A ~A ~A more text here ~A ~A" list)
Run Code Online (Sandbox Code Playgroud)

并有输出

1这里有一些文字2 3 4这里有更多文字5 6

如何在不调用(第1列表)(第2列表)等的情况下执行此操作?

Xac*_*ach 11

(format t "~{~A some text here ~A ~A ~A more text here ~A ~A~}" list)
Run Code Online (Sandbox Code Playgroud)


hua*_*uan 7

尝试

(apply #'format t "~A some text here ~A ~A ~A more text here ~A ~A" list)