problem with cl-who

Discussion of Common Lisp
Post Reply
djdebaviere
Posts: 13
Joined: Fri Dec 04, 2009 1:30 pm

problem with cl-who

Post by djdebaviere » Wed Dec 23, 2009 5:23 am

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.

Code: Select all

(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

Code: Select all

*** - 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)

janders468
Posts: 16
Joined: Fri Oct 17, 2008 12:27 pm

Re: problem with cl-who

Post by janders468 » Wed Dec 23, 2009 4:33 pm

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:

Code: Select all

(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.

Harleqin
Posts: 71
Joined: Wed Dec 17, 2008 5:18 am
Location: Bonn, Germany

Re: problem with cl-who

Post by Harleqin » Fri Jan 08, 2010 11:16 am

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

Post Reply