r5192: *** empty log message ***
authorKevin M. Rosenberg <kevin@rosenberg.net>
Tue, 24 Jun 2003 17:57:17 +0000 (17:57 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Tue, 24 Jun 2003 17:57:17 +0000 (17:57 +0000)
2/htmlgen.lisp

index 3149977974f92978fcb5e8cfc340e7664afef3be..46abc6d1ba5fc6451f34ac613ab9e925f6a0d576 100644 (file)
@@ -1,6 +1,6 @@
 ;; -*- mode: common-lisp; package: lml2 -*-
 ;;
-;; $Id: htmlgen.lisp,v 1.7 2003/06/24 17:51:22 kevin Exp $
+;; $Id: htmlgen.lisp,v 1.8 2003/06/24 17:57:17 kevin Exp $
 ;;
 ;; copyright (c) 1986-2000 Franz Inc, Berkeley, CA 
 ;; copyright (c) 2003 Kevin Rosenberg
 
 (defmacro html-out-stream-check (stream)
   ;; ensure that a real stream is passed to this function
-  `(let ((.str. ,stream))
-     (if* (not (streamp .str.))
-       then (error "html-stream must be passed a stream object, not ~s"
-                   .str.))
-     .str.))
+  (let ((s (gensym)))
+  `(let ((,s ,stream))
+     (unless (streamp ,s)
+       (error "html-stream must be passed a stream object, not ~s" ,s))
+    ,s)))
 
 
 (defmacro html-stream (stream &rest forms)
 (defun html-body-key-form (string-code has-inv args body)
   ;; do what's needed to handle given keywords in the args
   ;; then do the body
-  (if* (and args (atom args))
-     then ; single arg 
-         (return-from html-body-key-form
-           (case args
-             (:set (if* has-inv
-                        then `(write-string  ,(format nil "<~a>" string-code)
-                               *html-stream*)
-                        else `(write-string  ,(format nil "<~a />" string-code)
-                               *html-stream*)))
-             (:unset (if* has-inv
-                          then `(write-string  ,(format nil "</~a>" string-code)
-                                 *html-stream*)))
-             (t (error "illegal arg ~s to ~s" args string-code)))))
+  (when (and args (atom args))
+    ;; single arg 
+    (return-from html-body-key-form
+      (case args
+       (:set (if* has-inv
+                  then `(write-string  ,(format nil "<~a>" string-code)
+                         *html-stream*)
+                  else `(write-string  ,(format nil "<~a />" string-code)
+                         *html-stream*)))
+       (:unset (if* has-inv
+                    then `(write-string  ,(format nil "</~a>" string-code)
+                           *html-stream*)))
+       (t (error "illegal arg ~s to ~s" args string-code)))))
   
-  (if* (not (evenp (length args)))
-       then (warn "arg list ~s isn't even" args))
+  (unless (evenp (length args))
+    (warn "arg list ~s isn't even" args))
   
   
   (if* args