r5062: return from san diego
authorKevin M. Rosenberg <kevin@rosenberg.net>
Fri, 6 Jun 2003 21:59:30 +0000 (21:59 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Fri, 6 Jun 2003 21:59:30 +0000 (21:59 +0000)
api.lisp
base.lisp
downloads.lisp
files.lisp
lml.asd
package.lisp
read-macro.lisp
stdsite.lisp
utils.lisp

index eb584d4cd94ee6c80bc97c3043670877eefacd23..6530189687fadf99a533f090f6dfc74d0015ed40 100644 (file)
--- a/api.lisp
+++ b/api.lisp
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg based on Matthew Danish's code
 ;;;; Date Started:  Nov 2002
 ;;;;
-;;;; $Id: api.lisp,v 1.1 2002/11/08 06:00:12 kevin Exp $
+;;;; $Id: api.lisp,v 1.2 2003/06/06 21:59:30 kevin Exp $
 ;;;;
 ;;;; This file, part of LML, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;; and Copyright (c) 2002 Matthew Danish
@@ -17,8 +17,7 @@
 ;;;; (http://www.gnu.org/licenses/gpl.html)
 ;;;; *************************************************************************
 
-(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0)))
-(in-package :lml)
+(in-package #:lml)
 
 ;;; Copyright (c) 2002 Matthew Danish.
 ;;; All rights reserved.
index 2411ffd82575e87bd39989a76a9829d2d2ee0627..5944405fc11a78e0f37ec63403ca7bc51d1c7ff7 100644 (file)
--- a/base.lisp
+++ b/base.lisp
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Aug 2002
 ;;;;
-;;;; $Id: base.lisp,v 1.15 2003/05/26 14:53:33 kevin Exp $
+;;;; $Id: base.lisp,v 1.16 2003/06/06 21:59:30 kevin Exp $
 ;;;;
 ;;;; This file, part of LML, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
@@ -16,8 +16,7 @@
 ;;;; (http://www.gnu.org/licenses/gpl.html)
 ;;;; *************************************************************************
 
-(declaim (optimize (debug 3) (speed 3) (safety 3) (compilation-speed 0)))
-(in-package :lml)
+(in-package lml)
 
 (defun html4-prologue-string ()
   "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">")
index 8cd2e32ec2f9c0ad6463bdff7836d4d2131041b0..36f599c2e612e361d1f411dadb193fa4f10c5e4f 100644 (file)
@@ -2,12 +2,12 @@
 ;;;; *************************************************************************
 ;;;; FILE IDENTIFICATION
 ;;;;
-;;;; Name:          downloads.cl
+;;;; Name:          downloads.lisp
 ;;;; Purpose:       Generate downloads page
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Aug 2002
 ;;;;
-;;;; $Id: downloads.lisp,v 1.8 2003/02/03 00:43:36 kevin Exp $
+;;;; $Id: downloads.lisp,v 1.9 2003/06/06 21:59:30 kevin Exp $
 ;;;;
 ;;;; This file, part of LML, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
@@ -16,8 +16,7 @@
 ;;;; (http://www.gnu.org/licenses/gpl.html)
 ;;;; *************************************************************************
 
-(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0)))
-(in-package :lml)
+(in-package lml)
 
 
 (defvar *dl-base*)
@@ -70,7 +69,7 @@
 (defun display-footer ()
   (when *signed*
     (lml-princ "<h3>GPG Public Key</h3>")
-    (lml-princ "Use this <a href=\"https://www.b9.com/key.asc\">key</a> to verify file signtatures"))
+    (lml-princ "Use this <a href=\"https://www.b9.com/kevin.gpg.asc\">key</a> to verify file signtatures"))
   (lml-princ "</div>"))
   
 (defun print-sect-title (title)
 (defun match-base-name? (name)
   (let ((len-base-name (length *base-name*)))
     (when (>= (length name) len-base-name)
-      (dotimes (i len-base-name)
-       (declare (fixnum i))
-       (unless (char= (char *base-name* i)
-                      (char name i))
-         (return-from match-base-name? nil)))))
-  t)
+      (string= name *base-name* :end1 len-base-name :end2 len-base-name))))
 
 (defun filter-against-base (files)
-  (let ((filtered '()))
-    (dolist (f files)
-      (let ((name (pathname-name f)))
-       (when (match-base-name? name)
-         (push f filtered))))
-    (when filtered
-      (sort filtered #'(lambda (a b) (when (and a b)
-                                      (string<
-                                       (namestring a)
-                                       (namestring b))))))))
+  (delete-if-not #'(lambda (f) (match-base-name? (pathname-name f))) files))
+
+(defun sort-pathnames (list)
+  (sort list #'(lambda (a b) (string< (namestring a) (namestring b)))))
 
 (defun display-one-section (title pat)
-  (let ((files (filter-against-base (directory pat))))
+  (let ((files (sort-pathnames (filter-against-base (directory pat)))))
     (when files
       (print-sect-title title)
       (lml-princ "<div style=\"padding-left: 20pt;\">")
       (list-files files)
       (lml-princ "</div>"))))
 
-
 (defun display-sections (sects)
   (when sects
     (let ((title (car sects))
          (value (cadr sects)))
       (if (consp title)
-         (map nil #'display-sections sects)
+         (dolist (sect sects) (display-sections sect))
        (if (consp value)
            (progn
              (print-sect-title title)
index bdf4e96ca1481193fc621f30940f478e106f6173..cf1633f736eb1d63a2811f00989bb92d3d4bf285 100644 (file)
@@ -14,8 +14,7 @@
 ;;;; (http://www.gnu.org/licenses/gpl.html)
 ;;;; *************************************************************************
 
-(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0)))
-(in-package :lml)
+(in-package #:lml)
 
 (eval-when (:compile-toplevel :load-toplevel :execute)
   (defvar *output-dir* nil)
@@ -61,8 +60,8 @@
 (defun lml-load-path (file)
   (if (probe-file file)
       (with-open-file (in file :direction :input)
-        (do ((form (read in nil 'lml::eof) (read in nil 'lml::eof)))
-           ((eq form 'lml::eof))
+        (do ((form (read in nil 'eof) (read in nil 'eof)))
+           ((eq form 'eof))
          (eval form)))
     (format *trace-output* "Warning: unable to load LML file ~S" file)))
 
diff --git a/lml.asd b/lml.asd
index ec28c2e3bb5c4f67445d1ff9d39a8480bded5256..b07bcb0be26cda36b709829af137a07e3a58890f 100644 (file)
--- a/lml.asd
+++ b/lml.asd
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Aug 2002
 ;;;;
-;;;; $Id: lml.asd,v 1.14 2003/04/19 03:56:40 kevin Exp $
+;;;; $Id: lml.asd,v 1.15 2003/06/06 21:59:30 kevin Exp $
 ;;;;
 ;;;; This file, part of LML, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
 ;;;; (http://www.gnu.org/licenses/gpl.html)
 ;;;; *************************************************************************
 
-(in-package :asdf)
+(in-package #:cl-user)
+(defpackage #:lml-system (:use #:asdf #:cl))
+(in-package #:lml-system)
 
-(defsystem :lml
-  :name "cl-lml"
+(defsystem lml
+  :name "lml"
   :author "Kevin M. Rosenberg <kevin@rosenberg.net>"
-  :version "2.4.0"
+  :version "2.4"
   :maintainer "Kevin M. Rosenberg <kmr@debian.org>"
   :licence "GNU General Public License"
   :description "Lisp Markup Language"
@@ -37,6 +39,6 @@
    (:file "downloads" :depends-on ("base"))
    ))
 
-
-
-
+(defmethod perform ((o test-op) (c (eql (find-system 'lml))))
+  (operate 'load-op 'lml-tests)
+  (operate 'test-op 'lml-tests))
index f919107e30f78ba5db2d030892da87cebfaf9d8f..d3eae52a711846c5ba15e5ceb826df4138e857eb 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Aug 2002
 ;;;;
-;;;; $Id: package.lisp,v 1.5 2003/05/26 14:53:33 kevin Exp $
+;;;; $Id: package.lisp,v 1.6 2003/06/06 21:59:30 kevin Exp $
 ;;;;
 ;;;; This file, part of LML, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
@@ -16,9 +16,9 @@
 ;;;; (http://www.gnu.org/licenses/gpl.html)
 ;;;; *************************************************************************
 
-(in-package :cl-user)
+(in-package cl-user)
 
-(defpackage #:lisp-markup-language
+(defpackage lisp-markup-language
   (:use #:common-lisp)
   (:nicknames #:lml)
   (:export
index 4ce43d28688dbc867ae3980e015044ba48c829fb..0981adde5c6196a43d6a2d10fd6b50589754a7d7 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Aug 2002
 ;;;;
-;;;; $Id: read-macro.lisp,v 1.1 2003/04/27 17:53:16 kevin Exp $
+;;;; $Id: read-macro.lisp,v 1.2 2003/06/06 21:59:30 kevin Exp $
 ;;;;
 ;;;; This file, part of LML, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
@@ -16,8 +16,7 @@
 ;;;; (http://www.gnu.org/licenses/gpl.html)
 ;;;; *************************************************************************
 
-(declaim (optimize (debug 3) (speed 3) (safety 3) (compilation-speed 0)))
-(in-package :lml)
+(in-package #:lml)
 
 
 (set-macro-character #\[
index a0e99849beeaee0c398dbfef8dabe6b25be59a98..1836d7cdff63aa8710c5ad43b23e892abaa3354b 100644 (file)
@@ -2,12 +2,12 @@
 ;;;; *************************************************************************
 ;;;; FILE IDENTIFICATION
 ;;;;
-;;;; Name:          stdsite.cl
+;;;; Name:          stdsite.lisp
 ;;;; Purpose:       Functions to create my standard style sites
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Aug 2002
 ;;;;
-;;;; $Id: stdsite.lisp,v 1.3 2003/01/24 08:51:41 kevin Exp $
+;;;; $Id: stdsite.lisp,v 1.4 2003/06/06 21:59:30 kevin Exp $
 ;;;;
 ;;;; This file, part of LML, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
@@ -24,8 +24,7 @@
 ;;;  content.lml_
 ;;;  footer.lml_
 
-(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0)))
-(in-package :lml)
+(in-package #:lml)
 
 (defmacro std-head (title &body body)
   `(head 
index dcd099530255f25c9a00bfa723103499cad1c414..6ce238437347d831eb09e705fc639bd4570060db 100644 (file)
@@ -1,9 +1,8 @@
-;;; $Id: utils.lisp,v 1.7 2003/03/12 17:01:48 kevin Exp $
+;;; $Id: utils.lisp,v 1.8 2003/06/06 21:59:30 kevin Exp $
 ;;;;
 ;;;; General purpose utilities
 
-(in-package :lml)
-
+(in-package #:lml)
 
 (defmacro aif (test then &optional else)
   `(let ((it ,test))
        (string-equal "keyword" (package-name (symbol-package x)))))
 
 (defun list-to-spaced-string (list)
-  (if (consp list) 
-      (format nil "~A~{ ~A~}" (first list) (rest list))
-      ""))
+  (format nil "~{~A~^ ~}" list))
 
+(defun print-n-chars (char n stream)
+  (declare (fixnum n)
+          (optimize (speed 3) (safety 0) (space 0)))
+  (do ((i 0 (1+ i)))
+      ((= i n) char)
+    (declare (fixnum i))
+    (write-char char stream)))
+  
 (defun indent-spaces (n &optional (stream *standard-output*))
   "Indent n*2 spaces to output stream"
-  (let ((fmt (format nil "~~~DT" (+ n n))))
-    (format stream fmt)))
+  (print-n-chars #\space (+ n n) stream))
 
 (defun print-file-contents (file &optional (strm *standard-output*))
   "Opens a reads a file. Returns the contents as a single string"
                    (do ((line (read-line in nil 'eof) 
                               (read-line in nil 'eof)))
                        ((eql line 'eof))
-                     (format strm "~A~%" line)))))
+                     (write-string line strm)
+                     (write-char #\newline strm)))))
 
 (defun date-string (ut)
-  (if (typep ut 'integer)
-      (multiple-value-bind (sec min hr day mon year dow daylight-p zone)
-         (decode-universal-time ut)
-       (declare (ignore daylight-p zone))
-       (format nil "~[Mon~;Tue~;Wed~;Thu~;Fri~;Sat~;Sun~], ~d ~[Jan~;Feb~;Mar~;Apr~;May~;Jun~;Jul~;Aug~;Sep~;Oct~;Nov~;Dec~] ~d ~2,'0d:~2,'0d:~2,'0d" 
-               dow
-               day
-               (1- mon)
-               year
-               hr min sec))))
+  (check-type ut integer)
+  (multiple-value-bind (sec min hr day mon year dow daylight-p zone)
+      (decode-universal-time ut)
+    (declare (ignore daylight-p zone))
+    (format nil "~[Mon~;Tue~;Wed~;Thu~;Fri~;Sat~;Sun~], ~d ~[Jan~;Feb~;Mar~;Apr~;May~;Jun~;Jul~;Aug~;Sep~;Oct~;Nov~;Dec~] ~d ~2,'0d:~2,'0d:~2,'0d" 
+           dow day (1- mon) year hr min sec)))
 
 (defun lml-quit (&optional (code 0))
-  "Function to exit the Lisp implementation. Copied from CLOCC's QUIT function."
+  "Function to exit the Lisp implementation."
     #+allegro (excl:exit code)
     #+clisp (#+lisp=cl ext:quit #-lisp=cl lisp:quit code)
     #+(or cmu scl) (ext:quit code)
@@ -78,4 +79,4 @@
   #+mcl (ccl:mac-default-directory)
   #-(or allegro clisp cmu scl sbcl cormanlisp lispworks lucid mcl) (truename "."))
 
-  
+