Frage

Könnte jemand geben Sie mir ein einfaches expample eines clisp Skript, das verwendet

  • CGI
  • / usr / local / bin / clisp
  • CL-WHO oder gleichwertig?

Meine Installation ist, die aus apache2, clisp und Quicklisp.

Vielen Dank im Voraus!

War es hilfreich?

Lösung

Quicklisp ist eine gute Wahl. Dann spielt es keine Rolle, ob Sie clisp, sbcl oder CCL als Implementierung verwenden.

Führen Sie diese in der Schale:

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

Führen Sie dies im 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))

Ausgabe:

[...]
;;  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>
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top