cl-who
(특히 with-html-output-to-string
및 with-html-output
)을 사용하는 데 문제가 있는지 또는 Common Lisp을 이해하는 데 문제가 있는지 확실하지 않습니다. Lisp을 사용하는 나의 첫번째 프로젝트). 이 기능, 즉 사용하는 경우함수를 사용하여 cl-who : with-html-output을 무시하는 매개 변수
(defun form-field (type name label)
(cl-who:with-html-output (*standard-output* nil)
(:div :class "field"
(:label :for name label)
(:input :type type :name name))))
: 무시 (form-field "text" "username" "Username")
매개 변수 label
보인다을 ... HTML 출력은 다음과 같습니다
<div class="field"><label for="username"></label>
<input type="text" name="username"/></div>
나는 양식 필드를 생성하는 함수를 만들어 예상 출력 대신 :
<div class="field"><label for="username">Username</label>
<input type="text" name="username"/></div>
기능과 인쇄 문을 추가
(defun form-field (type name label)
(cl-who:with-html-output (*standard-output* nil)
(print label)
(:div :class "field"
(:label :for name label)
(:input :type type :name name))))
은 "사용자 이름"문자열이 성공적으로 출력 (여전히 HTML에서 무시를) ... 어떤 아이디어는 어떻게이 발생할 수 있습니다?
hunchentoot과 함께 사용하기 위해 cl-who:with-html-output-to-string
내에서이 함수를 호출합니다.