r11859: Canonicalize whitespace
[pipes.git] / src.lisp
index 506b84f6bd5c02d486201c176bd9f4c93476370d..c1d058be485838e40adeb0e11c08878205a34118 100644 (file)
--- a/src.lisp
+++ b/src.lisp
@@ -20,7 +20,7 @@
   `(cons ,head #'(lambda () ,tail)))
 
 (defun pipe-tail (pipe)
-  "Return tail of pipe or list, and destructively update 
+  "Return tail of pipe or list, and destructively update
    the tail if it is a function."
   (if (functionp (rest pipe))
     (setf (rest pipe) (funcall (rest pipe)))
@@ -38,7 +38,7 @@
 (defun pipe-enumerate (pipe &key count key (result pipe))
   "Go through all (or count) elements of pipe,
    possibly applying the KEY function. (Try PRINT.)"
-  ;; Returns RESULT, which defaults to the pipe itself. 
+  ;; Returns RESULT, which defaults to the pipe itself.
   (if (or (eq pipe +empty-pipe+) (eql count 0))
     result
     (progn
@@ -61,11 +61,11 @@ if the pipe is infinite in length."
   (if (eq pipe +empty-pipe+)
       +empty-pipe+
     (let ((head (pipe-head pipe))
-         (tail (pipe-tail pipe)))
+          (tail (pipe-tail pipe)))
       (if (funcall predicate head)
-         (make-pipe head (pipe-filter predicate tail))
+          (make-pipe head (pipe-filter predicate tail))
         (pipe-filter predicate tail)))))
-               
+
 
 (defun pipe-map (fn pipe)
   "Map fn over pipe, delaying all but the first fn call."
@@ -85,10 +85,10 @@ if the pipe is infinite in length."
            (result (funcall fn head)))
       (if (or (and filter-pred (funcall filter-pred result))
               result)
-         (make-pipe result (pipe-map-filtering fn tail filter-pred))
+          (make-pipe result (pipe-map-filtering fn tail filter-pred))
         (pipe-map-filtering fn tail filter-pred)))))
 
-      
+
 (defun pipe-append (x y)
   "Return a pipe that appends the elements of x and y."
   (if (eq x +empty-pipe+)
@@ -104,7 +104,7 @@ if the pipe is infinite in length."
     (let ((x (funcall fn (pipe-head pipe))))
       (make-pipe (pipe-head x)
                  (pipe-append (pipe-tail x)
-                             (pipe-mappend fn (pipe-tail pipe)))))))
+                              (pipe-mappend fn (pipe-tail pipe)))))))
 
 (defun pipe-mappend-filtering (fn pipe &optional filter-pred)
   "Map fn over pipe, delaying all but the first fn call,
@@ -116,7 +116,7 @@ if the pipe is infinite in length."
            (result (funcall fn head)))
       (if (or (and filter-pred (funcall filter-pred result))
               result)
-         (make-pipe (pipe-head result)
-                    (pipe-append (pipe-tail result)
-                                 (pipe-mappend-filtering fn tail filter-pred)))
+          (make-pipe (pipe-head result)
+                     (pipe-append (pipe-tail result)
+                                  (pipe-mappend-filtering fn tail filter-pred)))
         (pipe-mappend-filtering fn tail filter-pred)))))