Lisp 在format函数中使用列表的元素
我想做一些类似的事情:Lisp 在format函数中使用列表的元素,lisp,common-lisp,clisp,Lisp,Common Lisp,Clisp,我想做一些类似的事情: (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 我如何在不调用(第n个1列表)(第n个2列表)等的情况下执行此操作?试试看 (apply #'format t "~A some text here ~A ~A ~A more text here ~A ~A" list) (应
(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
我如何在不调用(第n个1列表)(第n个2列表)等的情况下执行此操作?试试看
(apply #'format t "~A some text here ~A ~A ~A more text here ~A ~A" list)
(应用#“格式t”~A此处的一些文本~A~A~此处的更多文本~A~A”列表)
(format t "~{~A some text here ~A ~A ~A more text here ~A ~A~}" list)