<div dir="ltr">I am trying to incorporate parenscript into cl-who tree. I tried to insert a small macro but for some reasons I get various errors linke "cl-who:fmt not defined" or ":script not defined".<br>
I guess I need help to figure out the way macros work with cl-who...<br><br>(defmacro js-body (&rest body)<br>  `(:script :type "text/javascript"<br>            (fmt <br>             (ps<br>               ,@body))))<br>
<br>(with-html-output-to-string (*standard-output* nil :prologue nil :indent nil)<br>   (:html<br>    (:head (:title "Some title"))<br>    (js-body<br>     (defun some-func ()<br>       (alert "Hello!")))))<br>
<br>I think parenscript is not really relevant to the task, so I am looking for some help to figure out why I have these expansion errors.<br>BTW, when I run <br>(macroexpand<br> '(with-html-output-to-string (*standard-output* nil :prologue nil :indent nil)<br>
   (:html<br>    (:head (:title "Some title"))<br>    (js-body<br>     (defun some-func ()<br>       (alert "Hello!"))))))<br><br>I get:<br><br>(LET ((*STANDARD-OUTPUT* (MAKE-STRING-OUTPUT-STREAM :ELEMENT-TYPE 'CHARACTER)))<br>
  (UNWIND-PROTECT<br>      (PROGN<br>       (WITH-HTML-OUTPUT (*STANDARD-OUTPUT* NIL :PROLOGUE NIL :INDENT NIL)<br>                         (:HTML (:HEAD (:TITLE "Some title"))<br>                          (JS-BODY (DEFUN SOME-FUNC () (ALERT "Hello!"))))))<br>
    (CLOSE *STANDARD-OUTPUT*))<br>  (GET-OUTPUT-STREAM-STRING *STANDARD-OUTPUT*))<br><br>The HyperSpec says: "<a href="#macroexpand" rel="DEFINITION"><b>macroexpand</b></a> repeatedly expands 
<i>form</i> until it is no longer a <a href="26_glo_m.htm#macro_form" rel="DEFINITION"><i>macro form"</i></a><br>Why js-body or with-html-output doesn't get expanded in this case? I am using sbcl 1.0.18 on Ubuntu.<br>
<br>Thank you!<br>Andrew<br></div>