 
   The array-coerce-fn is an optional function taking the name of an array field,
   and returning the collection to be used for array values."
-  [^BufferedReader reader & [key-fn array-coerce-fn]]
-  (when reader
-    (parsed-seq* (.createJsonParser ^SmileFactory
-                                    (or factory/*smile-factory*
-                                        factory/smile-factory) reader)
-                 key-fn array-coerce-fn)))
+  ([reader] (parsed-smile-seq reader nil nil))
+  ([reader key-fn] (parsed-smile-seq reader key-fn nil))
+  ([^BufferedReader reader key-fn array-coerce-fn]
+     (when reader
+       (parsed-seq* (.createJsonParser ^SmileFactory
+                                       (or factory/*smile-factory*
+                                           factory/smile-factory) reader)
+                    key-fn array-coerce-fn))))
 
 ;; aliases for clojure-json users
 (def encode generate-string)

  The array-coerce-fn is an optional function taking the name of an array field,
  and returning the collection to be used for array values.
  If laziness is needed, see parsed-seq."
  [^BufferedReader rdr & [key-fn array-coerce-fn]]
  (when rdr
    (parse/parse
     (.createJsonParser ^JsonFactory (or factory/*json-factory*
                                         factory/json-factory) rdr)
     key-fn nil array-coerce-fn)))

(defn parse-smile
  "Returns the Clojure object corresponding to the given SMILE-encoded bytes.


  The array-coerce-fn is an optional function taking the name of an array field,
  and returning the collection to be used for array values."
  ([bytes] (parse-smile bytes nil nil))
  ([bytes key-fn] (parse-smile bytes key-fn nil))
  ([^bytes bytes key-fn array-coerce-fn]
     (when bytes
       (parse/parse
        (.createJsonParser ^SmileFactory (or factory/*smile-factory*
                                             factory/smile-factory) bytes)
        key-fn nil array-coerce-fn))))

(def ^{:doc "Object used to determine end of lazy parsing attempt."}
  eof (Object.))
