2

我想做类似的事情:

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

并有输出

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

我如何在不调用 (nth 1 list) (nth 2 list) 等的情况下做到这一点?

4

2 回答 2

11
(format t "~{~A some text here ~A ~A ~A more text here ~A ~A~}" list)
于 2010-12-19T19:54:26.407 回答
7

尝试

(应用 #'format t "~A some text here ~A ~A ~A more text here ~A ~A" 列表)
于 2010-12-19T19:04:11.177 回答