                     result)
                   (let [v (vec (.toArray a))]
                     (.clear a)
-                    (let [ret (f1 result v)]
+                    (let [ret (rf result v)]
                       (when-not (reduced? ret)
                         (.add a input))
                       ret)))))))))

  (pred item) returns true. pred must be free of side-effects.
  Returns a transducer when no collection is provided."
  ([pred]
    (fn [f1]
      (fn
        ([] (f1))
        ([result] (f1 result))
        ([result input]
           (if (pred input)
             (f1 result input)
             result)))))
  ([pred coll]
   (lazy-seq

  there are fewer than n.  Returns a stateful transducer when
  no collection is provided."
  ([n]
     (fn [rf]
       (let [na (atom n)]
         (fn
           ([] (rf))
           ([result] (rf result))
           ([result input]
              (let [n @na
                    nn (swap! na dec)
                    result (if (pos? n)
                             (rf result input)
                             result)]
                (if (not (pos? nn))
                  (reduced result)
