Index: trunk/parse3.lisp
===================================================================
--- trunk/parse3.lisp	(revision trunk,9)
+++ trunk/parse3.lisp	(revision trunk,10)
@@ -5,5 +5,5 @@
 
 (defmacro if-matcher-parser (input parser (next match)
-				   &body (&optional (then t) else))
+			     &body (&optional (then t) else))
   (declare (symbol parser next match))
   (with-gensyms (ok)
@@ -12,5 +12,5 @@
 
 (defmacro if-matches-char (input char (next match)
-				 &body (&optional (then t) else))
+			   &body (&optional (then t) else))
   (declare (symbol next match)
 	   (character char))
@@ -34,5 +34,5 @@
 
 (defmacro if-matches-regex (input regex (next match)
-				  &body (&optional (then t) else))
+			    &body (&optional (then t) else))
   (declare (string regex)
 	   (symbol next match))
@@ -48,5 +48,5 @@
 
 (defmacro if-matches-choice (input alts (next match)
-				   &body (&optional (then t) else))
+			     &body (&optional (then t) else))
   (declare (symbol next match)
 	   (list alts))
@@ -66,16 +66,12 @@
 	  `(if-matches ,input ,head (,head-next ,head-match)
 	    (if-matches-sequence ,head-next ,tail (,next ,tail-match)
-	      (let ((,match (append ,head-match ,tail-match)))
+	      (let ((,match (cons ,head-match (list ,tail-match))))
 		,then)
 	      ,else)
 	    ,else))
-	(with-gensyms (head-match)
-	  `(if-matches ,input ,head (,next ,head-match)
-	    (let ((,match ,head-match))
-	      ,then)
-	    ,else)))))
+	`(if-matches ,input ,head (,next ,match) ,then ,else))))
 
 (defmacro if-matches-eqcount (input count rule (next match)
-				    &body (&optional (then t) else))
+			      &body (&optional (then t) else))
   "WARNING: ELSE code executes in an anonymous block!"
   (declare ((or null (integer 0)) count)
@@ -88,10 +84,11 @@
 	  (if-matches ,next ,rule (,next2 ,match2)
 	    (setf ,next ,next2
-		  ,match (nconc ,match (list ,match2)))
+		  ,match (cons ,match2 ,match))
 	    (return-from ,r ,else)))
+	(setf ,match (nreverse ,match))
 	,then))))
 
 (defmacro if-matches-maxcount (input count rule (next match)
-				     &body (&optional (then t) else))
+			       &body (&optional (then t) else))
   (declare ((or null (integer 0)) count)
 	   (symbol next match)
@@ -105,11 +102,13 @@
 		      (progn
 			(psetf ,next ,next2
-			       ,match (nconc ,match (list ,match2))
+			       ,match (cons ,match2 ,match)
 			       ,i (1+ ,i))
 			t)))))
+      (setf ,match (nreverse ,match))
       ,then)))
 
 (defmacro if-matches-count (input mincount maxcount rule (next match)
-				  &body (&optional (then t) else))
+			    &body (&optional (then t) else))
+  (when (and maxcount mincount) (setf maxcount (- maxcount mincount)))
   (with-gensyms (next2 match2)
     `(if-matches-eqcount ,input ,mincount ,rule (,next2 ,match2)
