我不清楚你想做什么。如果你想在 pieces 中编写一个网页,可以通过函数生成页面的部分,你可以使用 str 在调用其中一个函数时,例如:
str
(defun f1 () (with-html-output-to-string (*output-string*) (:p "some text"))) (defun f2 () (with-html-output-to-string (*output-string*) (:body (:p "some other text") (str (f1))))) (f2) "<body><p>some other text</p><p>some text</p></body>"
来自 手册 :
表格看起来像 (str form) 将被替换 (let ((result form)) (when result (princ result s)))
(str form)
(let ((result form)) (when result (princ result s)))
如果你不使用 str 相反,结果不包含在html输出中:
(defun f3 () (with-html-output-to-string (*output-string*) (:body (:p "some other text") (f1)))) (f3) "<body><p>some other text</p></body>"