Lisp Web Programming - Problem with starting a server

Discussion of Common Lisp

Lisp Web Programming - Problem with starting a server

Postby GengyangCai » Sun Jul 08, 2012 3:57 pm

Hello all,


This is a question regarding starting a server to do web programming. I am currently reading Peter Seibel's book Practical Common Lisp and on page 367, it mentions that :

"You can start a server listening on port 2001 like this:
WEB> (start :port 2001)
#<WSERVER port 2001 @ #x72511c72>"

On typing this into the terminal, I got a message that said : Error: attempt to call 'START' which is an undefined function. [condition type: UNDEFINED-FUNCTION].

Does anyone know what the problem here is and how I can fix it? Thanks a lot !


Gengyang Cai
GengyangCai
 
Posts: 3
Joined: Sun Jul 08, 2012 3:50 pm

Re: Lisp Web Programming - Problem with starting a server

Postby smithzv » Sun Jul 08, 2012 8:02 pm

If that error message is correct, which I assume it is, START was either never defined or never imported into your web package. Are you sure that you defined your package as:

Code: Select all
(defpackage :com.gigamonkeys.web
  (:use :cl :net.aserve :com.gigamonkeys.html))


If so, it looks as though something failed during the aserve compilation or loading. You could try reloading it or, a more definite fix, force recompilation by deleting the compiled files. I don't know where these are kept on your system. If you are on a Debian/Ubuntu like system, they are probably in .cache/common-lisp/imp-version-dir/path/to/aserve/.

This happens to me periodically with other libraries. Alas I cannot say why or how it happens or how to avoid it.
smithzv
 
Posts: 94
Joined: Wed Jul 23, 2008 11:36 am

Re: Lisp Web Programming - Problem with starting a server

Postby GengyangCai » Tue Jul 10, 2012 3:53 pm

Hello Smithz,

Now I think the problem might be that I didn't follow the initial instructions on page 366 to load the AllegroServe code into the Lisp image. Here were the 3 error responses when I tried following the directions :

1) When I typed (require :aserve) , the response was "NIL" .
2) When I typed require :aserve , the response was Error: Attempt to take the value of the unbound variable 'REQUIRE'. [condition type; UNBOUND-VARIABLE]
3) When I typed INSTALL.LISP, the response was Error: Attempt to take the value of the unbound variable 'INSTALL.LISP'. [condition type: UNBOUND VARIABLE}

Thanks ...
GengyangCai
 
Posts: 3
Joined: Sun Jul 08, 2012 3:50 pm

Re: Lisp Web Programming - Problem with starting a server

Postby smithzv » Tue Jul 10, 2012 6:09 pm

I honestly don't remember if or how PCL goes over how to load 3rd party libraries, but things have changed since it has been written anyway. We have a new and improved way to install libraries, here is the short form:

1. Download this file: http://beta.quicklisp.org/quicklisp.lisp

2. At the lisp repl, eval this: (load #p"/path/to/quicklisp.lisp") then this: (quicklisp-quickstart:install) then this: (ql:add-to-init-file)

3. Now, whenever you want a package, eval (ql:quickload :package-name) To load aserve: (ql:quickload :aserve)

See www.quicklisp.org/beta for more information on how to use the program, like how to find out what is available.

After (ql:quickload :aserve) you can continue with PCL.
smithzv
 
Posts: 94
Joined: Wed Jul 23, 2008 11:36 am


Return to Common Lisp

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 2 guests