<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Hi Kenny -<DIV><BR class="khtml-block-placeholder"><DIV><DIV><DIV>Am 13.05.2007 um 03:51 schrieb Ken Tilton:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><BLOCKQUOTE type="cite"><DIV>The first problem was writing the html to standard output instead of a string, the second problem is that cl-who does not quite work the way you think. What I did was replace as-html with the appropriate with-html-output form and then macroexpand.<BR></DIV></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Hm - ok - now that you say it ... Obviously the right thing to do. I was looking for Cells misuse anywhere - wrong. It was the CL-WHO side which I did not get right. Oh well....</DIV><BR><BLOCKQUOTE type="cite"><DIV> Give it a try. Meanwhile, this works:</DIV><DIV><BR></DIV><DIV>(defpackage #:whofix</DIV><DIV> (:use #:common-lisp #:cells #:cl-who))</DIV><DIV><BR></DIV><DIV>(in-package :whofix)</DIV><DIV><BR></DIV><DIV>(defmacro as-html (var &body body)</DIV><DIV> `(with-output-to-string (,var)</DIV><DIV> (with-html-output (,var)</DIV><DIV> ,@body)</DIV><DIV> ))</DIV></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV>As this is working as-html has to be changed because in CL-WHO there's </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><FONT class="Apple-style-span" face="Courier New">(defmacro with-html-output-to-string ((var &optional string-form</FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier New"> &key (element-type ''character)</FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier New"> prologue</FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier New"> indent)</FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier New"> &body body)</FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier New"> "Transform the enclosed BODY consisting of HTML as s-expressions</FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier New">into Lisp code which creates the corresponding HTML as a string."</FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier New"> `(with-output-to-string (,var ,string-form</FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier New"> #-(or :ecl :cmu :sbcl) :element-type</FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier New"> #-(or :ecl :cmu :sbcl) ,element-type)</FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier New"> (with-html-output (,var nil :prologue ,prologue :indent ,indent)</FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier New"> ,@body)))</FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier New"><BR class="khtml-block-placeholder"></FONT></DIV><DIV>So, we can write:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><FONT class="Apple-style-span" face="Courier New">(defmacro as-html (&body body)</FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier New"> `(with-html-output-to-string (*standard-output* nil :prologue nil)</FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier New"> ,@body))</FONT></DIV></DIV><BR></DIV><DIV>Hm - coming back to your remark </DIV><DIV> </DIV><BLOCKQUOTE type="cite">the second problem is that cl-who does not quite work the way you think</BLOCKQUOTE><BR></DIV><DIV>Well, I think I have understood that I have to output any data via write-string because this is what is to be inserted between tags... Anything else?</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Thx anyway!</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Frank</DIV><DIV><BR class="khtml-block-placeholder"></DIV></BODY></HTML>