[cl-who-devel] Interpolate lisp code inside the tag body

Matus Kmit simply.nitaai at gmail.com
Mon Aug 1 20:42:00 UTC 2011


Excellent. THANKS.

Matus

On Mon, Aug 1, 2011 at 8:23 PM, Sebastian Tennant
<sebyte at smolny.plus.com> wrote:
> Quoth Matus Kmit <simply.nitaai at gmail.com>:
>> Does that mean that one should use only with-html-output-to-string for
>> publishing
>
> Yes.  Let's say your dispatch handler (a hunchentoot term) calls function
> home-page, then home-page should look like this:
>
> (defun home-page ()
>  (with-html-output-to-string (*http-stream*)
>    (:p ...)
>    ...))
>
> where *http-stream* is defined as a special variable, like so:
>
> (defun *http-stream* nil)
>
> Now, let's assume home-page includes a call to function navbar.
>
> navbar doesn't need to use w-h-o-t-s.  This will suffice:
>
> (defun (navbar ()
>  (with-html-output (*http-stream*)
>    (:div :id "navbar" ...)
>    ...))
>
> In short, only the 'top-level' function called by your dispatch handler
> needs to use w-h-o-t-s.
>
> Hope this helps.
>
> Sebastian
>
>
> _______________________________________________
> cl-who-devel site list
> cl-who-devel at common-lisp.net
> http://common-lisp.net/mailman/listinfo/cl-who-devel
>




More information about the Cl-who-devel mailing list