[clhp-cvs] CVS update: clhp/utility.lisp clhp/clhp.lisp clhp/clhp.asd clhp/cgi.lisp clhp/ChangeLog clhp/.cvsignore
Anthony Ventimiglia
aventimiglia at common-lisp.net
Fri Oct 17 13:11:45 UTC 2003
Update of /project/clhp/cvsroot/clhp
In directory common-lisp.net:/tmp/cvs-serv9555
Modified Files:
clhp.lisp clhp.asd cgi.lisp ChangeLog .cvsignore
Added Files:
utility.lisp
Log Message:
* (Module): Moved COND-BIND, IF-BIND, A-LIST-VALUE,
CA-LIST-TO-A-LIST, MAKE-KEYWORD, and LIST-TO-A-LIST out of
cgi.lisp in here.
* clhp.asd, package.lisp, clhp.lisp, cgi.lisp: Converted all this
to an ASDF system, it's not quite battle tested, but hey, that's
what this is all about.
Date: Fri Oct 17 09:11:44 2003
Author: aventimiglia
Index: clhp/clhp.lisp
diff -u clhp/clhp.lisp:1.16 clhp/clhp.lisp:1.17
--- clhp/clhp.lisp:1.16 Fri Oct 17 08:58:04 2003
+++ clhp/clhp.lisp Fri Oct 17 09:11:44 2003
@@ -1,5 +1,5 @@
(ext:file-comment
- "$Id: clhp.lisp,v 1.16 2003/10/17 12:58:04 aventimiglia Exp $")
+ "$Id: clhp.lisp,v 1.17 2003/10/17 13:11:44 aventimiglia Exp $")
;;
;; CLHP the Common Lisp Hypertext Preprocessor
;; (C) 2003 Anthony J Ventimiglia
@@ -21,18 +21,6 @@
;; email: aventimiglia at common-lisp.net
;; HomePage: http://common-lisp.net/project/clhp/
-;(eval-when (:compile-toplevel)
-; (unless (find-package :cgi)
-; (load "cgi")))
-
-;(defpackage #:net.common-lisp.aventimiglia.clhp
-; (:nicknames :clhp)
-; (:use :cgi :cl)
-; (:import-from :cgi #:cond-bind #:list-to-a-list)
-; (:export #:parse #:*clhp-version* #:echo #:include #:xml-element
-; #:make-xml-element #:copy-xml-element #:xml-element-attributes
-; #:xml-element-name #:xml-element-contents #:xml-element-p #:tag))
-
(in-package :clhp)
;; This elaborate reader macro converts the cvs Date keywords and
@@ -41,7 +29,7 @@
;; will override the CVS keyword
(defconstant *CLHP-VERSION*
#.(or nil ; Set this for releases
- (let* ((trimmed (string-trim "$ Date:" "$Date: 2003/10/17 12:58:04 $"))
+ (let* ((trimmed (string-trim "$ Date:" "$Date: 2003/10/17 13:11:44 $"))
(date (subseq trimmed 0 (search " " trimmed))))
(concatenate 'string
(subseq date 0 4)
@@ -83,8 +71,8 @@
to use CLHP. See README for an example."
(use-package :cgi)
(use-package :clhp)
- (cgi:init)
- (cgi:header :content-type
+ (init)
+ (header :content-type
:text/html
:extra
'(#.(format
Index: clhp/clhp.asd
diff -u clhp/clhp.asd:1.1 clhp/clhp.asd:1.2
--- clhp/clhp.asd:1.1 Fri Oct 17 08:58:04 2003
+++ clhp/clhp.asd Fri Oct 17 09:11:44 2003
@@ -1,5 +1,4 @@
-#+cmu (ext:file-comment "$Id: clhp.asd,v 1.1 2003/10/17 12:58:04 aventimiglia Exp $")
-;; -*- lisp -*-
+#+cmu (ext:file-comment "$Id: clhp.asd,v 1.2 2003/10/17 13:11:44 aventimiglia Exp $")
;;
;; CLHP the Common Lisp Hypertext Preprocessor
;; (C) 2003 Anthony J Ventimiglia
@@ -37,5 +36,6 @@
:licence "GNU Lesser General Public License"
:components
((:file "package")
- (:file "cgi" :depends-on ("package"))
+ (:file "utility" :depends-on ("package"))
+ (:file "cgi" :depends-on ("utility"))
(:file "clhp" :depends-on ("cgi"))))
Index: clhp/cgi.lisp
diff -u clhp/cgi.lisp:1.11 clhp/cgi.lisp:1.12
--- clhp/cgi.lisp:1.11 Fri Oct 17 08:58:04 2003
+++ clhp/cgi.lisp Fri Oct 17 09:11:44 2003
@@ -1,4 +1,4 @@
-#+cmu (ext:file-comment "$Id: cgi.lisp,v 1.11 2003/10/17 12:58:04 aventimiglia Exp $")
+#+cmu (ext:file-comment "$Id: cgi.lisp,v 1.12 2003/10/17 13:11:44 aventimiglia Exp $")
;;
;; CLHP the Common Lisp Hypertext Preprocessor
;; (C) 2003 Anthony J Ventimiglia
@@ -20,17 +20,7 @@
;; email: aventimiglia at common-lisp.net
;; HomePage: http://common-lisp.net/project/clhp/
-;(defpackage #:net.common-lisp.aventimiglia.cgi
-; (:nicknames #:cgi)
-; (:use :cl)
-; (:export #:*server-env* #:*query-vars* #:header #:debug #:init))
-
-(in-package :cgi)
-
-(defmacro make-keyword (name)
- "Translates a string into a keyword: (MAKE-KEYWORD \"foo\") -->
-:FOO"
- `(read-from-string (format nil ":~a" ,name)))
+(in-package :clhp)
(defmacro debug (expression)
"Print out EXPRESSION and the result of (EVAL EXPRESSION)"
@@ -42,19 +32,6 @@
ex: (EXPLODE-STRING (\"Hello\") --> (#\H #\e #\l #\l #\o)"
`(concatenate 'list ,string))
-(defmacro a-list-value (key a-list)
- "returns the value from a (KEY . VALUE) A-LIST"
- `(cadr (assoc ,key ,a-list)))
-
-(defmacro cond-bind ((&rest bindings) &body body)
- "A COND wrapped in a Let"
- `(let (, at bindings) (cond , at body)))
-
-(defmacro if-bind ((&rest bindings) test if else)
- "An IF wrapped in a LET"
- `(let (, at bindings) (if ,test ,if ,else)))
-
-
;; External Symbol section
(defvar *server-env* nil
@@ -92,10 +69,6 @@
(format t "Content-type: ~a~%~%" content-type)
(setf done t))))
-(defun ca-list-to-a-list (list)
- "Converts a CONS type a-list '((A . 3)(B . 4)) to a list type '((A 3)(B 4))"
- (mapcar #'(lambda (cons) (list (car cons)(cdr cons))) list))
-
;; This sets the main variables, since the library is already part of the lisp
;; core, we can't use an eval-when, I may eventually make a cgi:init that also
;; prints the header.
@@ -180,19 +153,6 @@
(a-list-value :CONTENT_LENGTH *server-env*))))
post-char-list)
post-char-list)))
-
-(defun list-to-a-list (list &optional a-list)
- "Converts a list to an a-list, pairing odd and even elements. If an
-odd number of elements are in LIST, the last element is returnes as
-the second value.
-ex: (LIST-TO-A-LIST '(a b c d) --> '((a b)(c d)) NIL
-ex: (LIST-TO-A-LIST '(1 2 3 4 5) --> '((1 2)(3 4)) 5"
- (cond
- ((null list) (nreverse a-list))
- ((= 1 (length list)) (values (nreverse a-list) (car list)))
- (t (list-to-a-list (cddr list)
- (cons (list (car list) (cadr list))
- a-list)))))
(defun query-to-a-list (get/post-data)
(list-to-a-list
Index: clhp/ChangeLog
diff -u clhp/ChangeLog:1.15 clhp/ChangeLog:1.16
--- clhp/ChangeLog:1.15 Fri Oct 17 08:58:04 2003
+++ clhp/ChangeLog Fri Oct 17 09:11:44 2003
@@ -1,5 +1,9 @@
2003-10-17 <ant at afghan.dogpound>
+ * (Module): Moved COND-BIND, IF-BIND, A-LIST-VALUE,
+ CA-LIST-TO-A-LIST, MAKE-KEYWORD, and LIST-TO-A-LIST out of
+ cgi.lisp in here.
+
* clhp.asd, package.lisp, clhp.lisp, cgi.lisp: Converted all this
to an ASDF system, it's not quite battle tested, but hey, that's
what this is all about.
@@ -97,4 +101,4 @@
used to create tables from (CONS . TYPE) a-lists. Also added some
comments.
-$Id: ChangeLog,v 1.15 2003/10/17 12:58:04 aventimiglia Exp $
\ No newline at end of file
+$Id: ChangeLog,v 1.16 2003/10/17 13:11:44 aventimiglia Exp $
\ No newline at end of file
Index: clhp/.cvsignore
diff -u clhp/.cvsignore:1.2 clhp/.cvsignore:1.3
--- clhp/.cvsignore:1.2 Fri Oct 17 08:58:04 2003
+++ clhp/.cvsignore Fri Oct 17 09:11:44 2003
@@ -3,3 +3,4 @@
clhp.x86f
package.x86f
start-clcgi.x86f
+utility.x86f
More information about the Clhp-cvs
mailing list