Welcome! Please see the About page for a little more info on how this works.

+3 votes
ago in Docs by

(doc slurp) says


clojure.core/slurp
([f & opts])
Opens a reader on f and reads all its contents, returning a string.
See clojure.java.io/reader for a complete list of supported arguments.

(doc clojure.java.io/reader) says


clojure.java.io/reader
([x & opts])
Attempts to coerce its argument into an open java.io.Reader.
Default implementations always return a java.io.BufferedReader.

Default implementations are provided for Reader, BufferedReader,
InputStream, File, URI, URL, Socket, byte arrays, character arrays,
and String.

If argument is a String, it tries to resolve it first as a URI, then
as a local file name. URIs with a 'file' protocol are converted to
local file names.

Should be used inside with-open to ensure the Reader is properly
closed.

I read the source code, and I was confused even more.

1 Answer

0 votes
ago by

This is fair. I created https://clojure.atlassian.net/browse/CLJ-2944 to track this.

...