Hi!
In page 50 of the book, chapter 3. In the clojure.core/read section it has the following text:
One important note is that the read functions read the “next” value from the character stream or string and leave or ignore any value after that. The
readandread-stringfunctions have special options that allow you to ensure the input is fully read if needed.
I don’t understand what that means. My understanding initially reading this was that it is possible to read all the values present in the string/stream, but checking the documentation I don’t see this.
Reading the doc of read.
(doc read)
-------------------------
clojure.core/read
([] [stream] [stream eof-error? eof-value] [stream eof-error? eof-value recursive?] [opts stream])
Reads the next object from stream, which must be an instance of
java.io.PushbackReader or some derivee. stream defaults to the
current value of *in*.
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
Note that read can execute code (controlled by *read-eval*),
and as such should be used only with trusted sources.
For data structure interop use clojure.edn/read
I guessed is what recursive? does, but trying it out doesn’t seem to be the case.
Can someone help me understand this section please?