Prev: email parser in Lisp?
Next: Google Code Jam 2010
From: Haris Bogdanovi� on 8 May 2010 10:54 Hi. I installed cl-who package in emacs with asdf. When I run code: ----------------------------------------------------------------- (defpackage :a (:use :cl :cl-who)) (in-package :a) ------------------------------------------------------------------- in emacs it works, but when I put it in cgi-bin folder of apache (xampp) and try to open that file via browser then it says that there is no cl-who package. I insert the first line for the browser: #!c:/lisp/clisp/clisp.exe . How do install a package permanently to work from all places ? Thanks
From: D Herring on 8 May 2010 11:29 On 05/08/2010 10:54 AM, Haris Bogdanovi� wrote: > I insert the first line for the browser: #!c:/lisp/clisp/clisp.exe . > How do install a package permanently to work from all places ? The trick is to make sure asdf knows where to find the libraries. I'd guess you have something that modifies asdf:*central-registry* in ~/.clisprc.lisp, but this init file isn't getting loaded by the cgi script. It may be best to set this variable directly at the top of your cgi script. - Daniel P.S. The upcoming ASDF2 has a slightly different configuration mechanism that should solve some problems like this.
From: Haris Bogdanovic on 9 May 2010 10:20 Ok, it works now. I guess every cgi script has to begin with loading packages, can it be remembered somehow ?
From: RG on 9 May 2010 11:19 In article <hs6gam$80h$1(a)gregory.bnet.hr>, "Haris Bogdanovic" <fbogdanovic(a)xnet.hr> wrote: > Ok, it works now. I guess every cgi script has to begin with loading > packages, can it be remembered somehow ? Not if you're running as a CGI. It is a fundamental property of CGI that it starts a completely new process on every invocation. But if you're running as a CGI you are missing one of the coolest features of Lisp: you can run an entire web server in a Lisp process which can invoke Lisp functions directly in order to produce dynamic HTML. Try this: http://www.weitz.de/hunchentoot/ rg
From: D Herring on 9 May 2010 13:22
On 05/09/2010 11:19 AM, RG wrote: > In article<hs6gam$80h$1(a)gregory.bnet.hr>, > "Haris Bogdanovic"<fbogdanovic(a)xnet.hr> wrote: > >> Ok, it works now. I guess every cgi script has to begin with loading >> packages, can it be remembered somehow ? > > Not if you're running as a CGI. It is a fundamental property of CGI > that it starts a completely new process on every invocation. > > But if you're running as a CGI you are missing one of the coolest > features of Lisp: you can run an entire web server in a Lisp process > which can invoke Lisp functions directly in order to produce dynamic > HTML. Try this: > > http://www.weitz.de/hunchentoot/ See also AllegroServ There are also tools like FastCGI that allow the server (e.g. Apache) to reuse CGI processes (e.g. lisp) for multiple invocations. I don't do much CGI stuff; so I don't remember the best solution for lisp; but it may be worth digging for. - Daniel |