This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.

problem with cl-who

3 posts · 1320 views

I have installed cl-who and when I am making the test with the code which are in the home page of cl-who, the running return an error.
(with-html-output (*http-stream*)
  (loop for (link . title) in '(("http://zappa.com/" . "Frank Zappa")
                                ("http://marcusmiller.com/" . "Marcus Miller")
                                ("http://www.milesdavis.com/" . "Miles Davis"))
        do (htm (:a :href link
                  (:b (str title)))
                :br)))
the message error is
*** - WITH-HTML-OUTPUT: (*HTTP-STREAM*) does not match lambda list element
       (SYSTEM::VAR STREAM &KEY (SYSTEM::DOCTYPE '*WITH-HTML-OUTPUT-DOCTYPE*)
        (SYSTEM::META '(:HTTP-EQUIV "Content-Type" :CONTENT "text/html"))
        SYSTEM::BASE SYSTEM::COMMENT (SYSTEM::TITLE "untitled")
        (SYSTEM::FOOTER T) SYSTEM::HEAD)

Re: problem with cl-who

If you read the instructions Edi has given, it says "assume that *HTTP-STREAM* is the stream your web application is supposed to write to" I believe that this implies that it should have previously been defined, if you just want to test the output to standard output try this:
(with-html-output (http-stream t)
  (loop for (link . title) in '(("http://zappa.com/" . "Frank Zappa")
                                ("http://marcusmiller.com/" . "Marcus Miller")
                                ("http://www.milesdavis.com/" . "Miles Davis"))
        do (htm (:a :href link
                  (:b (str title)))
                :br)))

this will bind http-stream to *standard-output* (t) or you can define a global variable called *http-stream* and bind it to whatever stream you want to output to.

Re: problem with cl-who

WITH-HTML-OUTPUT has two required parameters, but you provided only one.
"Just throw more hardware at it" is the root of all evil.
Svante