2011-01-12 6 views
3

는 누군가가 나에게CLISP 및 CL-WHO를 사용한 CGI 예?

  • CGI
  • /usr/지방/빈/CLISP
  • CL-WHO 또는 동등한를 사용하는 CLISP 스크립트의 간단한 expample를 제공 ​​할 수 있을까요?

내 설치는 apache2, clisp 및 quicklisp로 구성됩니다.

미리 감사드립니다.

답변

1

Quicklisp은 좋은 선택입니다. 그런 다음 clisp, sbcl 또는 ccl을 구현으로 사용하면 문제가되지 않습니다. 셸에서

실행이 :

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

실행이 리스프에서 :

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