This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-21
Channels
- # adventofcode (27)
- # announcements (2)
- # babashka (1)
- # beginners (111)
- # calva (11)
- # cider (82)
- # clara (6)
- # clojure (44)
- # clojure-dev (5)
- # clojure-europe (27)
- # clojure-nl (5)
- # clojure-spec (3)
- # clojure-uk (3)
- # clojurescript (29)
- # core-async (5)
- # cursive (4)
- # datalevin (1)
- # datomic (39)
- # exercism (4)
- # figwheel-main (1)
- # fulcro (32)
- # graalvm (7)
- # gratitude (1)
- # integrant (4)
- # jobs (1)
- # lein-figwheel (3)
- # leiningen (4)
- # lsp (3)
- # luminus (3)
- # meander (2)
- # nextjournal (1)
- # off-topic (10)
- # other-languages (26)
- # pathom (14)
- # polylith (9)
- # re-frame (16)
- # remote-jobs (1)
- # shadow-cljs (4)
- # specter (2)
- # sql (6)
- # timbre (2)
- # tools-build (12)
- # xtdb (9)
(clojure.repl/doc *in*)
-------------------------
clojure.core/*in*
A java.io.Reader object representing standard input for read operations.
Defaults to System/in, wrapped in a LineNumberingPushbackReader
=> nil
(clojure.repl/source read-line)
(defn read-line
"Reads the next line from stream that is the current value of *in* ."
{:added "1.0"
:static true}
[]
(if (instance? clojure.lang.LineNumberingPushbackReader *in*)
(.readLine ^clojure.lang.LineNumberingPushbackReader *in*)
(.readLine ^java.io.BufferedReader *in*)))
=> nil
The doc of *in*
say that it should be a Reader
But read-line
assumes that *in*
is a BufferedReader
Reader
do not have .readLine
method.I agree that seems inconsistent
there's a bit of dynamic type weirdness here that LineNumberingPushbackReader and BufferedReader both have .readLine, but not through any common interface
I think really the expectation is "Reader and has .readLine method"
there's an old ticket related to this https://clojure.atlassian.net/browse/CLJ-1611