(read reader)
(read {:keys [eof], :as opts} reader)
(read reader eof-error? eof opts)
Reads the first object from an cljs.tools.reader.reader-types/IPushbackReader.
Returns the object read. If EOF, throws if eof-error? is true otherwise returns eof.
If no reader is provided, *in* will be used.
Reads data in the edn format (subset of Clojure data):
http://edn-format.org
cljs.tools.reader.edn/read doesn't depend on dynamic Vars, all configuration
is done by passing an opt map.
opts is a map that can include the following keys:
:eof - value to return on end-of-file. When not supplied, eof throws an exception.
:readers - a map of tag symbols to data-reader functions to be considered before default-data-readers.
When not supplied, only the default-data-readers will be used.
:default - A function of two args, that will, if present and no reader is found for a tag,
be called with the tag and the value.
Source
(defn
read
"Reads the first object from an cljs.tools.reader.reader-types/IPushbackReader.\n Returns the object read. If EOF, throws if eof-error? is true otherwise returns eof.\n If no reader is provided, *in* will be used.\n\n Reads data in the edn format (subset of Clojure data):\n http://edn-format.org\n\n cljs.tools.reader.edn/read doesn't depend on dynamic Vars, all configuration\n is done by passing an opt map.\n\n opts is a map that can include the following keys:\n :eof - value to return on end-of-file. When not supplied, eof throws an exception.\n :readers - a map of tag symbols to data-reader functions to be considered before default-data-readers.\n When not supplied, only the default-data-readers will be used.\n :default - A function of two args, that will, if present and no reader is found for a tag,\n be called with the tag and the value."
([reader]
(edn/read
{:readers @*tag-table*,
:default @*default-data-reader-fn*,
:eof nil}
reader))
([{:keys [eof], :as opts} reader]
(edn/read
(update
(merge opts {:default @*default-data-reader-fn*})
:readers
(fn [m] (merge @*tag-table* m)))
reader))
([reader eof-error? eof opts]
(edn/read
reader
eof-error?
eof
(update
(merge opts {:default @*default-data-reader-fn*})
:readers
(fn [m] (merge @*tag-table* m))))))