CGIS与CLISP和CL-WHO的例子?

时间:2011-01-12 14:37:47

标签: common-lisp clisp quicklisp cl-who

有人可以为我提供一个使用

的clisp脚本的简单示例
  • CGI
  • / usr / local / bin / clisp
  • CL-WHO或同等学历?

我的安装包括apache2,clisp和quicklisp。

提前致谢!

1 个答案:

答案 0 :(得分:1)

Quicklisp是一个不错的选择。那么使用clisp,sbcl或ccl作为实现并不重要。

在shell中运行:

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>
相关问题