Skip to main content

read

function

clojure.tools.reader/read

Available in:BBCLJ
(read [] [reader] [opts reader] [reader eof-error? eof-value])
Reads the first object from an IPushbackReader or a java.io.PushbackReader. Returns the object read. If EOF, throws if eof-error? is true. Otherwise returns sentinel. If no stream is provided, *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 ***WARNING*** Note that read can execute code (controlled by *read-eval*), and as such should be used only with trusted sources. 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

No examples yet. Be the first to add one!

Categories