Fwd: factor 1 body cosmetics

Gabor Melis <[email protected]> Mon, 8 Nov 2004 14:10:36 +0100
Newsgroups gmane.lisp.open-source.franz
Message-ID <[email protected]>
--Boundary-00=_MB3jBf99JSlUOek
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hello

I've been advised to forward this here and hopefully get it included. The 
patch is against portable aserve.

Cheers, Gabor

--Boundary-00=_MB3jBf99JSlUOek
Content-Type: message/rfc822;
  name*=
Content-Transfer-Encoding: 7bit
Content-Description: Gabor Melis <[email protected]>: factor 1 body cosmetics
Content-Disposition: inline;
	filename*=

From: Gabor Melis <[email protected]>
To: [email protected]
Subject: factor 1 body cosmetics
Date: Tue, 11 May 2004 12:30:23 +0200
User-Agent: KMail/1.6.2
MIME-Version: 1.0
Content-Disposition: inline
Content-Type: Multipart/Mixed;
  boundary="Boundary-00=_/sKoACOtS8jhEQf"
Message-Id: <[email protected]>


--Boundary-00=_/sKoACOtS8jhEQf
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Subject: 

No, it's not spam. Hmm, but if you have a dry skin ... Nevermind.

At a few places in paserve the macro body parameter is preceded by &rest which 
should really be &body stylistically. I bring this up only because with this 
SLIME could indent code properly:

(with-http-response (req ent)
  (with-http-body (req ent)
    (princ "Hello World!" *html-stream*)))

instead of the highly annoying:

(with-http-response (req ent)
                    (with-http-body (req ent)
                                    (princ "Hello World!" *html-stream*)))

Yeah, I know I could tell emacs how to indent these macros, but IMHO it's 
better anyway to be explicit about the intentions.

Cheers, Gabor

--Boundary-00=_/sKoACOtS8jhEQf
Content-Type: text/x-diff;
  charset="us-ascii";
  name="aserve-body.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="aserve-body.patch"

--- client.cl~	2004-05-11 12:12:43.000000000 +0200
+++ client.cl	2004-05-11 12:12:43.000000000 +0200
@@ -93,7 +93,7 @@
 (defvar crlf (make-array 2 :element-type 'character
 			 :initial-contents '(#\return #\linefeed)))
 
-(defmacro with-better-scan-macros (&rest body)
+(defmacro with-better-scan-macros (&body body)
   ;; define the macros for scanning characters in a string
   `(macrolet ((collect-to (ch buffer i max &optional downcasep)
 		;; return a string containing up to the given char
--- macs.cl~	2004-05-11 12:12:43.000000000 +0200
+++ macs.cl	2004-05-11 12:12:43.000000000 +0200
@@ -200,13 +200,13 @@
 ; else use read-write timeouts
 ; 
 #-(and allegro (version>= 6 1))
-(defmacro with-timeout-local ((time &rest actions) &rest body)
+(defmacro with-timeout-local ((time &rest actions) &body body)
   ;; same as with-timeout 
   `(acl-compat.mp:with-timeout (,time ,@actions) ,@body))   ; ok w-t
 
 
 #+(and allegro (version>= 6 1))
-(defmacro with-timeout-local ((time &rest actions) &rest body)
+(defmacro with-timeout-local ((time &rest actions) &body body)
   (declare (ignore time))
   (let ((g-blocktag (gensym)))
     `(block ,g-blocktag
--- main.cl~	2004-05-11 12:12:43.000000000 +0200
+++ main.cl	2004-05-11 12:12:43.000000000 +0200
@@ -148,7 +148,7 @@
 		     (format nil ,@(cdr args)))
 		   *debug-stream*))))
 
-(defmacro if-debug-action (kind &rest body)
+(defmacro if-debug-action (kind &body body)
   ;; only do if the debug value is high enough
   `(progn (if* (member ,kind *debug-current* :test #'eq)
 	     then ,@body)))
@@ -489,7 +489,7 @@
 				    content-type
 				    format
 				    )
-			      &rest body)
+			      &body body)
   ;;
   ;; setup to response to an http request
   ;; do the checks that can shortciruit the request
@@ -539,7 +539,7 @@
 			   &key headers 
 				(external-format 
 				 '*default-aserve-external-format*))
-			  &rest body)
+			  &body body)
   (declare (ignorable external-format))
   (let ((g-req (gensym))
 	(g-ent (gensym))

--Boundary-00=_/sKoACOtS8jhEQf--

--Boundary-00=_MB3jBf99JSlUOek--