Question

Quelqu'un pourrait-il me fournir d'un simple expample d'un script clisp, qui utilise

  • CGI
  • / usr / local / bin / clisp
  • CL-OMS ou équivalent?

Mon installation est composée de apache2, clisp et quicklisp.

Merci à l'avance!

Était-ce utile?

La solution

Quicklisp est un bon choix. Ensuite, il n'a pas d'importance si vous utilisez clisp, sbcl ou ccl comme une mise en œuvre.

Exécuter ce dans le shell:

wget http://beta.quicklisp.org/quicklisp.lisp
clisp

Exécuter ce dans le Lisp:

(load "quicklisp.lisp")
(quicklisp-quickstart:install)
(ql:add-to-init-file)
(ql:quickload "cl-who")
(defpackage :webmaker
  (:use :cl :cl-who))
(in-package :webmaker)
(with-html-output (*standard-output* nil :prologue t)
    (:html (:body "Not much there"))
    (values))

Sortie:

[...]
;;  Loaded file /home/xxx/quicklisp/setup.lisp
;; Loaded file /home/xxx/.clisprc.lisp
[1]> (ql:quickload "cl-who")
To load "cl-who":
  Load 1 ASDF system:
    cl-who
; Loading "cl-who"

("cl-who")
[2]> (defpackage :webmaker
  (:use :cl :cl-who))
#<PACKAGE WEBMAKER>
[3]> (in-package :webmaker)
#<PACKAGE WEBMAKER>
WEBMAKER[4]> 
(with-html-output (*standard-output* nil :prologue t)
    (:html (:body "Not much there"))
    (values))
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html><body>Not much there</body></html>
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top