【问题标题】:CGI example with CLISP and CL-WHO?带有 CLISP 和 CL-WHO 的 CGI 示例?
【发布时间】:2011-06-07 21:15:36
【问题描述】:

谁能给我一个简单的 clisp 脚本示例,它使用

  • CGI
  • /usr/local/bin/clisp
  • CL-WHO 或同等级别?

我的安装由 apache2、clisp 和 quicklisp 组成。

提前致谢!

【问题讨论】:

    标签: common-lisp clisp quicklisp cl-who


    【解决方案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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-04-17
      • 1970-01-01
      • 2018-06-03
      • 1970-01-01
      • 2018-06-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多