(read reader)
(read {eof :eof, :as opts, :or {eof :eofthrow}} reader)
(read reader eof-error? sentinel)
Reads the first object from an IPushbackReader.
Returns the object read. If EOF, throws if eof-error? is true.
Otherwise returns sentinel. If no stream is providen, *in* will be used.
Opts is a persistent map with valid keys:
:read-cond - :allow to process reader conditionals, or
:preserve to keep all branches
:features - persistent set of feature keywords for reader conditionals
:eof - on eof, return value unless :eofthrow, then throw.
if not specified, will throw
To read data structures only, use clojure.tools.reader.edn/read
Note that the function signature of clojure.tools.reader/read and
clojure.tools.reader.edn/read is not the same for eof-handling
Source
(defn
read
"Reads the first object from an IPushbackReader.\n Returns the object read. If EOF, throws if eof-error? is true.\n Otherwise returns sentinel. If no stream is providen, *in* will be used.\n\n Opts is a persistent map with valid keys:\n :read-cond - :allow to process reader conditionals, or\n :preserve to keep all branches\n :features - persistent set of feature keywords for reader conditionals\n :eof - on eof, return value unless :eofthrow, then throw.\n if not specified, will throw\n\n To read data structures only, use clojure.tools.reader.edn/read\n\n Note that the function signature of clojure.tools.reader/read and\n clojure.tools.reader.edn/read is not the same for eof-handling"
{:arglists '([] [reader] [opts reader] [reader eof-error? eof-value])}
([reader] (read reader true nil))
([{eof :eof, :as opts, :or {eof :eofthrow}} reader]
(read* reader (= eof :eofthrow) eof nil opts (to-array [])))
([reader eof-error? sentinel]
(read* reader eof-error? sentinel nil {} (to-array []))))