3

誰かが私にclispスクリプトの簡単な例を提供してもらえますか?

  • CGI
  • / usr / local / bin / clisp
  • CL-WHOまたは同等のもの?

私のインストールは、apache2、clisp、quicklispで構成されています。

前もって感謝します!

4

1 に答える 1

1

Quicklispは良い選択です。次に、実装としてclisp、sbcl、またはcclを使用するかどうかは関係ありません。

シェルでこれを実行します。

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

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

出力:

[...]
;;  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>
于 2011-07-02T13:33:52.697 に答える