[hunchentoot-devel] Hunchentoot Recursive Function

Chris Van Dusen cavandusen at gmail.com
Wed Dec 16 11:50:54 UTC 2009


On Dec 16, 2009, at 5:20 AM, Phil Marneweck wrote:

> This is most likely a problem with my understanding of lisp and not
> hunchnetoot.
> 
> Why does the following function only out put "Recursive count- 0" to the
> hunchentoot page?
> 
> (defun recursive-test (count)
>  (with-html-output-to-string (*standard-output*)
>    (if (< count 10)
>        (recursive-test (+ count 1)))
>    (str (format nil "Recursive count- ~A" count))))
> 
> (define-easy-handler (test-recursive :uri "/test.html" () 
>    (with-html-output-to-string (*standard-output*)
>      (str (recursive-test 0))))
> 
It has to do with format being passed nil:  http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_format.html#format

Chris.

> 
> _______________________________________________
> tbnl-devel site list
> tbnl-devel at common-lisp.net
> http://common-lisp.net/mailman/listinfo/tbnl-devel





More information about the Tbnl-devel mailing list