<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Recent activity in REPL</title>
<link>https://ask.clojure.org/index.php/activity/clojure/repl</link>
<description></description>
<item>
<title>Closed: When using remote prepl server, *repl* is false, preventing use of add-lib and related functions</title>
<link>https://ask.clojure.org/index.php/14374/using-remote-prepl-server-false-preventing-related-functions?show=14374#q14374</link>
<description>&lt;p&gt;To reproduce:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;clojure -J-Dclojure.server.jvm=&quot;{:port 5555 :accept clojure.core.server/io-prepl}&quot;

Clojure 1.12.0
user=&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;then&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nc localhost 5555
*repl*
{:tag :ret, :val &quot;false&quot;, :ns &quot;user&quot;, :ms 0, :form &quot;*repl*&quot;}
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14374/using-remote-prepl-server-false-preventing-related-functions?show=14374#q14374</guid>
<pubDate>Tue, 21 Jul 2026 19:32:37 +0000</pubDate>
</item>
<item>
<title>Commented: Why does the REPL incorrectly display my command after I press enter?</title>
<link>https://ask.clojure.org/index.php/14848/why-does-repl-incorrectly-display-command-after-press-enter?show=14861#c14861</link>
<description>I'm on Ubuntu 20.04 and 0.43 was the latest I could get through apt, so I used brew install rlwrap and that gave me 0.48 -- thank you for the build-from-source suggestion since that made me think of brew!</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14848/why-does-repl-incorrectly-display-command-after-press-enter?show=14861#c14861</guid>
<pubDate>Tue, 23 Dec 2025 20:29:58 +0000</pubDate>
</item>
<item>
<title>Commented: Add function that returns every interned keyword in the runtime</title>
<link>https://ask.clojure.org/index.php/12171/add-function-that-returns-every-interned-keyword-the-runtime?show=14837#c14837</link>
<description>Just correct my comment above: since clojure.lang.Keyword.table isn't final, this issue isn't suspect to JEP 500. Still, having a public API to retrieve every interned keyword would be useful.</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12171/add-function-that-returns-every-interned-keyword-the-runtime?show=14837#c14837</guid>
<pubDate>Fri, 12 Dec 2025 19:35:13 +0000</pubDate>
</item>
<item>
<title>`(s/gen ...)` caches its failure to load generators and thus is incompatible with `add-lib`</title>
<link>https://ask.clojure.org/index.php/14718/gen-caches-failure-load-generators-thus-incompatible-with</link>
<description>&lt;pre&gt;&lt;code&gt;Clojure 1.12.0
user=&amp;gt; (require '[clojure.spec.alpha :as s])
nil
user=&amp;gt; (s/def ::x #{1 2 3})
:user/x
user=&amp;gt; (s/gen ::x)
Execution error (FileNotFoundException) at user/eval145 (REPL:1).
Could not locate clojure/test/check/generators__init.class, clojure/test/check/generators.clj or clojure/test/check/generators.cljc on classpath.
user=&amp;gt; (add-lib 'org.clojure/test.check)
[org.clojure/test.check]
user=&amp;gt; (s/gen ::x)
Execution error (FileNotFoundException) at user/eval145 (REPL:1).
Could not locate clojure/test/check/generators__init.class, clojure/test/check/generators.clj or clojure/test/check/generators.cljc on classpath.
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14718/gen-caches-failure-load-generators-thus-incompatible-with</guid>
<pubDate>Tue, 23 Sep 2025 16:23:58 +0000</pubDate>
</item>
<item>
<title>Answer selected: add-lib behavior with REPL started via -e</title>
<link>https://ask.clojure.org/index.php/14299/add-lib-behavior-with-repl-started-via-e?show=14304#a14304</link>
<description>&lt;p&gt;Definitely is classloader related. I assume the difference is that clojure.main/repl does:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(let [cl (.getContextClassLoader (Thread/currentThread))]
  (.setContextClassLoader (Thread/currentThread) (clojure.lang.DynamicClassLoader. cl)))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and clojure.main/eval-opt does not.&lt;/p&gt;
&lt;p&gt;Seems like your code could do that too.&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14299/add-lib-behavior-with-repl-started-via-e?show=14304#a14304</guid>
<pubDate>Fri, 13 Dec 2024 22:41:40 +0000</pubDate>
</item>
<item>
<title>Closed: prepl warnings remain buffered until explicit flushing from the client</title>
<link>https://ask.clojure.org/index.php/10735/prepl-warnings-remain-buffered-until-explicit-flushing-client?show=10735#q10735</link>
<description>&lt;p&gt;In a prepl session, Clojure warnings remain buffered and won't be sent to the client without flushing explicitly from the client side.&lt;/p&gt;
&lt;p&gt;Here is an example prepl session using &lt;code&gt;netcat&lt;/code&gt; (the lines starting with &lt;code&gt;;; &lt;/code&gt; indicate responses from the prepl server):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ clojure -X clojure.core.server/start-server :name prepl :port 5555 :accept clojure.core.server/io-prepl :server-daemon false &amp;amp;
$ nc localhost 5555

(set! *warn-on-reflection* true)
;; {:tag :ret, :val &quot;true&quot;, :ns &quot;user&quot;, :ms 2, :form &quot;(set! *warn-on-reflection* true)&quot;}

(.toString (identity &quot;foo&quot;))
;; {:tag :ret, :val &quot;\&quot;foo\&quot;&quot;, :ns &quot;user&quot;, :ms 4, :form &quot;(.toString (identity \&quot;foo\&quot;))&quot;}
(binding [*out* *err*] (flush))
;; {:tag :err, :val &quot;Reflection warning, NO_SOURCE_PATH:2:1 - reference to field toString can't be resolved.\n&quot;}
;; {:tag :ret, :val &quot;nil&quot;, :ns &quot;user&quot;, :ms 4, :form &quot;(binding [*out* *err*] (flush))&quot;}

(defn identity [x] x)
;; {:tag :ret, :val &quot;#'user/identity&quot;, :ns &quot;user&quot;, :ms 3, :form &quot;(defn identity [x] x)&quot;}
(binding [*out* *err*] (flush))
;; {:tag :err, :val &quot;WARNING: identity already refers to: #'clojure.core/identity in namespace: user, being replaced by: #'user/identity\n&quot;}
;; {:tag :ret, :val &quot;nil&quot;, :ns &quot;user&quot;, :ms 2, :form &quot;(binding [*out* *err*] (flush))&quot;}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This seems to be caused by the fact that prepl's &lt;code&gt;*err*&lt;/code&gt; PrintWriter is &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/clojure/blob/a29f9b911b569b0a4890f320ec8f946329bbe0fd/src/clj/clojure/core/server.clj#L224&quot;&gt;not &lt;code&gt;autoFlush&lt;/code&gt;-enabled&lt;/a&gt; and that most of the Clojure warnings are not flushed explicitly.&lt;/p&gt;
&lt;p&gt;Is this an issue to be addressed? Or is it an intended behavior and it's the client's responsibility to flush the error stream on a timely basis?&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10735/prepl-warnings-remain-buffered-until-explicit-flushing-client?show=10735#q10735</guid>
<pubDate>Sat, 15 Jun 2024 15:11:26 +0000</pubDate>
</item>
<item>
<title>Commented: prepl could have IDs for requests/responses</title>
<link>https://ask.clojure.org/index.php/13934/prepl-could-have-ids-for-requests-responses?show=13958#c13958</link>
<description>It would technically be possible to create a new *out* binding for each eval that carries that id. For CLJ at least, for CLJS due to the async nature that wouldn't be of much benefit. I agree though that it seems best to me to treat out/err streams as separate from evaluation since they can come from to many &amp;quot;sources&amp;quot;.</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13934/prepl-could-have-ids-for-requests-responses?show=13958#c13958</guid>
<pubDate>Thu, 06 Jun 2024 06:46:24 +0000</pubDate>
</item>
<item>
<title>Closed: add-libs, etc in clojure 1.12 alphas causing &quot;The filename or extension is too long&quot; on windows</title>
<link>https://ask.clojure.org/index.php/12916/libs-clojure-alphas-causing-filename-extension-long-windows?show=12916#q12916</link>
<description>&lt;p&gt;Using the new add-libs on Windows I seem to keep getting &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;CreateProcess error=206, The filename or extension is too long error.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is possibly related to a &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/TDEPS-120?focusedCommentId=49241&quot;&gt;similar issue&lt;/a&gt; caused by long classpath strings, but I'm getting this error when using &lt;code&gt;add-libs&lt;/code&gt;, even when adding the same dependencies to my deps.edn and restarting my repl would not cause the error.&lt;/p&gt;
&lt;p&gt;Original slack discussion that lead to this question:&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://clojurians.slack.com/archives/CFN4QDHPS/p1683207794496629&quot;&gt;https://clojurians.slack.com/archives/CFN4QDHPS/p1683207794496629&lt;/a&gt;&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12916/libs-clojure-alphas-causing-filename-extension-long-windows?show=12916#q12916</guid>
<pubDate>Wed, 05 Jun 2024 18:55:57 +0000</pubDate>
</item>
<item>
<title>Commented: define several Vars at once in the REPL (convenience fn/macro)</title>
<link>https://ask.clojure.org/index.php/13788/define-several-vars-at-once-in-the-repl-convenience-fn-macro?show=13792#c13792</link>
<description>`intern`, that's it! Thank you! Also, yeah solid advice regarding Portal/Reveal/REBL. Thanks again!</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13788/define-several-vars-at-once-in-the-repl-convenience-fn-macro?show=13792#c13792</guid>
<pubDate>Mon, 18 Mar 2024 15:40:27 +0000</pubDate>
</item>
<item>
<title>Commented: How to create a short-lived remote-prepl such that it can be gracefully shutdown?</title>
<link>https://ask.clojure.org/index.php/13760/create-short-lived-remote-prepl-such-that-gracefully-shutdown?show=13764#c13764</link>
<description>I tried out the latest patch (with the Printwriter-On changes) as well as the &amp;nbsp;`(binding [*out* *err*] (flush))` &amp;quot;hack solution&amp;quot; described in that thread. Unfortunately neither worked for me. It's probably related though. I will spend more time with it soon and report back.</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13760/create-short-lived-remote-prepl-such-that-gracefully-shutdown?show=13764#c13764</guid>
<pubDate>Tue, 27 Feb 2024 19:28:47 +0000</pubDate>
</item>
<item>
<title>Closed: add-libs fails when *print-length* is set in 1.12-alpha4</title>
<link>https://ask.clojure.org/index.php/13053/add-libs-fails-when-print-length-is-set-in-1-12-alpha4?show=13053#q13053</link>
<description>&lt;p&gt;In version &lt;code&gt;1.12.0-alpha4&lt;/code&gt;, calling any of the clojure.repl.deps/add-libs related functions will fail when &lt;code&gt;*print-length*&lt;/code&gt; is set, ostensibly to a number small enough to abbreviate your project's &lt;code&gt;:deps&lt;/code&gt; when printing them.&lt;/p&gt;
&lt;p&gt;So to reproduce, create a new project with 10 deps in deps.edn then&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(set! *print-length* 5)
(add-libs '{my/lib {:mvn/version &quot;0.1&quot;}}) ;;fails

(set! *print-length* nil)
(add-libs '{my/lib {:mvn/version &quot;0.1&quot;}})  ;;now it works
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I believe this is due to &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/clojure/blob/501348deb1e49736f3c49f2c177bcff947fe3a17/src/clj/clojure/tools/deps/interop.clj#L40&quot;&gt;this line&lt;/a&gt; in clojure.tools.deps.interop&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13053/add-libs-fails-when-print-length-is-set-in-1-12-alpha4?show=13053#q13053</guid>
<pubDate>Thu, 08 Feb 2024 22:37:50 +0000</pubDate>
</item>
<item>
<title>Answered: REPL not installed</title>
<link>https://ask.clojure.org/index.php/13210/repl-not-installed?show=13211#a13211</link>
<description>&lt;p&gt;You can try installing with &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/casselc/clj-msi&quot;&gt;https://github.com/casselc/clj-msi&lt;/a&gt; or &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/borkdude/deps.clj&quot;&gt;https://github.com/borkdude/deps.clj&lt;/a&gt; and see if those work better for you.&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13210/repl-not-installed?show=13211#a13211</guid>
<pubDate>Sun, 27 Aug 2023 15:40:20 +0000</pubDate>
</item>
<item>
<title>Answer selected: Clojure repl won't show previous command with up arrow</title>
<link>https://ask.clojure.org/index.php/12695/clojure-repl-wont-show-previous-command-with-up-arrow?show=12696#a12696</link>
<description>&lt;p&gt;&lt;code&gt;clojure&lt;/code&gt; is the Clojure CLI tool. &lt;code&gt;clj&lt;/code&gt; is a companion wrapper for it that adds rlwrap support for interactive editing, so try that instead.&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12695/clojure-repl-wont-show-previous-command-with-up-arrow?show=12696#a12696</guid>
<pubDate>Mon, 27 Feb 2023 08:14:36 +0000</pubDate>
</item>
<item>
<title>Answered: help binding `clojure.test/*test-out*` in clojure.main/repl :init</title>
<link>https://ask.clojure.org/index.php/12666/help-binding-clojure-test-test-out-in-clojure-main-repl-init?show=12667#a12667</link>
<description>&lt;p&gt;Answer: a misunderstanding. &lt;code&gt;clojure.main/repl&lt;/code&gt; uses &lt;code&gt;(with-bindings (init) ...)&lt;/code&gt; but this is not clojure.core/with-bindings but clojure.main/with-bindings.&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12666/help-binding-clojure-test-test-out-in-clojure-main-repl-init?show=12667#a12667</guid>
<pubDate>Mon, 13 Feb 2023 15:29:57 +0000</pubDate>
</item>
<item>
<title>Answered: There's no way to enable warn-on-reflection from the command-line when running clojure.main</title>
<link>https://ask.clojure.org/index.php/3787/theres-enable-warn-reflection-from-command-running-clojure?show=12656#a12656</link>
<description>&lt;p&gt;As a temporary workaround:&lt;/p&gt;
&lt;p&gt;Putting&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(alter-var-root #'*warn-on-reflection* (constantly true))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;in &lt;code&gt;user.clj&lt;/code&gt; also seems to work.&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/3787/theres-enable-warn-reflection-from-command-running-clojure?show=12656#a12656</guid>
<pubDate>Wed, 08 Feb 2023 16:35:57 +0000</pubDate>
</item>
<item>
<title>Answer selected: cant call function from clojure.core, dont know what's messed</title>
<link>https://ask.clojure.org/index.php/12498/cant-call-function-from-clojure-core-dont-know-whats-messed?show=12499#a12499</link>
<description>&lt;p&gt;If you are using Joyride, this isn't JVM Clojure.&lt;/p&gt;
&lt;p&gt;Joyride is a ClojureScript environment to script VSCode which is using SCI to interpret the ClojureScript. Like ClojureScript it has no &lt;code&gt;read-line&lt;/code&gt; function in the core library.&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12498/cant-call-function-from-clojure-core-dont-know-whats-messed?show=12499#a12499</guid>
<pubDate>Sun, 25 Dec 2022 23:33:16 +0000</pubDate>
</item>
<item>
<title>Comment edited: Could not locate clojure/core__init.class, clojure/core.clj or clojure/core.cljc on classpath</title>
<link>https://ask.clojure.org/index.php/12353/could-locate-clojure-coreinit-clojure-clojure-classpath?show=12384#c12384</link>
<description>Thanks, it connected sucecessfully, &amp;nbsp;There is a small modification:&lt;br /&gt;
&lt;br /&gt;
public static IPersistentMap evalCodeMap() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Map&amp;lt;Object, Object&amp;gt; map = Maps.newHashMap();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;map.put(Clojure.read(&amp;quot;:op&amp;quot;), Clojure.read(&amp;quot;eval&amp;quot;));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;map.put(Clojure.read(&amp;quot;:code&amp;quot;), Clojure.var(&amp;quot;clojure.core&amp;quot;, &amp;quot;eval&amp;quot;).invoke(&amp;quot;(+ 1 2)&amp;quot;));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return PersistentHashMap.create(map);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
Clojure.var(&amp;quot;nrepl.core&amp;quot;, &amp;quot;message&amp;quot;).invoke(client , evalCodeMap())&lt;br /&gt;
&lt;br /&gt;
BTW, It seems that Clojure code is more simple.&lt;br /&gt;
it better to code with Clojure then call Clojure from Java? How to do that? gen-class or require namespace?</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12353/could-locate-clojure-coreinit-clojure-clojure-classpath?show=12384#c12384</guid>
<pubDate>Sat, 12 Nov 2022 15:55:54 +0000</pubDate>
</item>
<item>
<title>Commented: prepl only issues referral warnings once - is that right?</title>
<link>https://ask.clojure.org/index.php/11808/prepl-only-issues-referral-warnings-once-is-that-right?show=11822#c11822</link>
<description>The method that reports that warning is `Namespace.warnOrFailOnReplace` and depending on how that method is called (via `intern` or `refer` or if nREPL uses it directly) and from where and which vars its checking it will report or not. Sadly, I don't know enough about nREPL to know how it might be calling that method.</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11808/prepl-only-issues-referral-warnings-once-is-that-right?show=11822#c11822</guid>
<pubDate>Tue, 26 Apr 2022 19:34:15 +0000</pubDate>
</item>
<item>
<title>Comment edited: Help writing a simple cider emacs defun to modify: cider-eval-last-sexp-to-repl</title>
<link>https://ask.clojure.org/index.php/11578/help-writing-simple-cider-emacs-defun-modify-cider-eval-last?show=11583#c11583</link>
<description>dpsutton - What a fast and brilliant answer! This adjusts Cider to my preferred work flow. The extra setting to keep the comment block from being the top-level form was something I hadn’t even expected to be able to fix. I’ve modified my config.el file and everything works exactly as I had hoped. Binding &amp;nbsp;'cider-insert-defun-in-repl (shown below) really optimizes my workflow. &lt;br /&gt;
&lt;br /&gt;
Thanks again!&lt;br /&gt;
&lt;br /&gt;
(define-key cider-mode-map (kbd &amp;quot;C-c RET&amp;quot;) 'cider-insert-defun-in-repl)</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11578/help-writing-simple-cider-emacs-defun-modify-cider-eval-last?show=11583#c11583</guid>
<pubDate>Mon, 14 Feb 2022 17:49:05 +0000</pubDate>
</item>
<item>
<title>Closed: io-prepl does not serialize exception thrown during serialization</title>
<link>https://ask.clojure.org/index.php/10429/prepl-does-serialize-exception-thrown-during-serialization?show=10429#q10429</link>
<description>&lt;p&gt;&lt;code&gt;io-prepl&lt;/code&gt; serializes eval results using &lt;code&gt;valf&lt;/code&gt; but leaves exception as is if serialized value throws exceptions on print.&lt;/p&gt;
&lt;p&gt;Repro:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# terminal 1
clj -X clojure.core.server/start-server \
  :name '&quot;io-prepl&quot;' \
  :port 7777 \
  :accept clojure.core.server/io-prepl \
  :server-daemon false

# terminal 2
nc localhost 7777
(reify Object (toString [_] (/ 1 0)))
{:tag :ret, :val {:via [{:type java.lang.ArithmeticException, :message &quot;Divide by zero&quot;, :at [clojure.lang.Numbers divide &quot;Numbers.java&quot; 188]}], :trace [[clojure.lang.Numbers divide &quot;Numbers.java&quot; 188] [clojure.lang.Numbers divide &quot;Numbers.java&quot; 3901] [user$eval220$reify__221 toString &quot;NO_SOURCE_FILE&quot; 3] [clojure.core$str invokeStatic &quot;core.clj&quot; 555] [clojure.core$print_object invokeStatic &quot;core_print.clj&quot; 117] [clojure.core$fn__7297 invokeStatic &quot;core_print.clj&quot; 120] [clojure.core$fn__7297 invoke &quot;core_print.clj&quot; 120] [clojure.lang.MultiFn invoke &quot;MultiFn.java&quot; 234] [clojure.core$pr_on invokeStatic &quot;core.clj&quot; 3662] [clojure.core$pr invokeStatic &quot;core.clj&quot; 3665] [clojure.core$pr invoke &quot;core.clj&quot; 3665] [clojure.lang.AFn applyToHelper &quot;AFn.java&quot; 154] [clojure.lang.RestFn applyTo &quot;RestFn.java&quot; 132] [clojure.core$apply invokeStatic &quot;core.clj&quot; 667] [clojure.core$pr_str invokeStatic &quot;core.clj&quot; 4724] [clojure.core$pr_str doInvoke &quot;core.clj&quot; 4724] [clojure.lang.RestFn invoke &quot;RestFn.java&quot; 408] [clojure.core.server$io_prepl$fn__8978$fn__8979 invoke &quot;server.clj&quot; 289] [clojure.core.server$io_prepl$fn__8978 invoke &quot;server.clj&quot; 288] [clojure.core.server$prepl$fn__8964 invoke &quot;server.clj&quot; 239] [clojure.core.server$prepl invokeStatic &quot;server.clj&quot; 228] [clojure.core.server$prepl doInvoke &quot;server.clj&quot; 191] [clojure.lang.RestFn invoke &quot;RestFn.java&quot; 425] [clojure.core.server$io_prepl invokeStatic &quot;server.clj&quot; 283] [clojure.core.server$io_prepl doInvoke &quot;server.clj&quot; 272] [clojure.lang.RestFn invoke &quot;RestFn.java&quot; 397] [clojure.lang.AFn applyToHelper &quot;AFn.java&quot; 152] [clojure.lang.RestFn applyTo &quot;RestFn.java&quot; 132] [clojure.lang.Var applyTo &quot;Var.java&quot; 705] [clojure.core$apply invokeStatic &quot;core.clj&quot; 667] [clojure.core.server$accept_connection invokeStatic &quot;server.clj&quot; 73] [clojure.core.server$start_server$fn__8902$fn__8903$fn__8905 invoke &quot;server.clj&quot; 117] [clojure.lang.AFn run &quot;AFn.java&quot; 22] [java.lang.Thread run &quot;Thread.java&quot; 834]], :cause &quot;Divide by zero&quot;, :phase :print-eval-result}, :ns &quot;user&quot;, :ms 3, :form &quot;(reify Object (toString [_] (/ 1 0)))&quot;, :exception true}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This causes problems for other prepls connected to io-prepl such as &lt;code&gt;remote-prepl&lt;/code&gt; that always deserializes using its valf:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# terminal 3
clj
Clojure 1.10.3
user=&amp;gt; ((requiring-resolve 'clojure.core.server/remote-prepl) &quot;localhost&quot; 7777 *in* prn)
(reify Object (toString [_] (/ 1 0)))
{:tag :ret, :val {:via [{:type java.lang.ClassCastException, :message &quot;class clojure.lang.PersistentArrayMap cannot be cast to class java.lang.String (clojure.lang.PersistentArrayMap is in unnamed module of loader 'app'; java.lang.String is in module java.base of loader 'bootstrap')&quot;, :at [clojure.core$read_string invokeStatic &quot;core.clj&quot; 3793]}], :trace [[clojure.core$read_string invokeStatic &quot;core.clj&quot; 3793] [clojure.core$read_string invoke &quot;core.clj&quot; 3793] [clojure.core.server$remote_prepl$fn__8992$fn__8994 invoke &quot;server.clj&quot; 322] [clojure.core.server$remote_prepl$fn__8992 invoke &quot;server.clj&quot; 321] [clojure.lang.AFn run &quot;AFn.java&quot; 22] [java.lang.Thread run &quot;Thread.java&quot; 834]], :cause &quot;class clojure.lang.PersistentArrayMap cannot be cast to class java.lang.String (clojure.lang.PersistentArrayMap is in unnamed module of loader 'app'; java.lang.String is in module java.base of loader 'bootstrap')&quot;, :phase :read-eval-result}, :ns &quot;user&quot;, :ms 1, :form &quot;(reify Object (toString [_] (/ 1 0)))&quot;, :exception true}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In this case, the original exception (division by zero during printing) is shadowed by another exception (class cast exception by attempting to &lt;code&gt;read-string&lt;/code&gt; a map)&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10429/prepl-does-serialize-exception-thrown-during-serialization?show=10429#q10429</guid>
<pubDate>Wed, 02 Feb 2022 21:51:22 +0000</pubDate>
</item>
<item>
<title>Answer selected: clojure.core.server/io-prepl doesn't support read-line</title>
<link>https://ask.clojure.org/index.php/11518/clojure-core-server-io-prepl-doesnt-support-read-line?show=11519#a11519</link>
<description>&lt;p&gt;Logged as &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2692&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2692&lt;/a&gt;&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11518/clojure-core-server-io-prepl-doesnt-support-read-line?show=11519#a11519</guid>
<pubDate>Fri, 28 Jan 2022 05:57:27 +0000</pubDate>
</item>
<item>
<title>Answered: clojure.main/report-error contains a call to pprint which may throw, obscuring the real failure</title>
<link>https://ask.clojure.org/index.php/11489/clojure-report-error-contains-pprint-which-obscuring-failure?show=11501#a11501</link>
<description>&lt;p&gt;I moved your support issue into &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2687&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2687&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;To have your patches considered, you'll need to sign the contributor agreement at &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.org/dev/contributor_agreement&quot;&gt;https://clojure.org/dev/contributor_agreement&lt;/a&gt;&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11489/clojure-report-error-contains-pprint-which-obscuring-failure?show=11501#a11501</guid>
<pubDate>Tue, 18 Jan 2022 15:53:07 +0000</pubDate>
</item>
<item>
<title>Commented: tools.deps - How do I list dependencies and their versions from the REPL?</title>
<link>https://ask.clojure.org/index.php/11268/tools-deps-how-list-dependencies-and-their-versions-from-repl?show=11388#c11388</link>
<description>I also use Alex's method shared in another answer, but sometimes this approach can reveal things that wouldn't be apparent otherwise, eg. a .clj or .class file that a library bundles accidentally / unexpectedly.</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11268/tools-deps-how-list-dependencies-and-their-versions-from-repl?show=11388#c11388</guid>
<pubDate>Mon, 13 Dec 2021 04:17:47 +0000</pubDate>
</item>
<item>
<title>Closed: Port 65535 incorrectly excluded</title>
<link>https://ask.clojure.org/index.php/3356/port-65535-incorrectly-excluded?show=3356#q3356</link>
<description>&lt;p&gt;The following code is used in {{src/clj/clojure/core/server.clj}} to validate whether a port number is valid:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;(defn- validate-opts
  &quot;Validate server config options&quot;
  [{:keys [name port accept] :as opts}]
  (doseq [prop [:name :port :accept]] (required opts prop))
  (when (or (not (integer? port)) (not (&amp;lt; -1 port 65535)))
(throw (ex-info (str &quot;Invalid socket server port: &quot; port) opts))))&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;However this is very slightly incorrect, since port 65535 is excluded but it is actually a valid port.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;`&lt;/code&gt;&lt;br&gt;
user=&amp;gt; (defn is-invalid-port [port] (or (not (integer? port)) (not (&amp;lt; -1 port 65535))))&lt;/p&gt;
&lt;h2&gt;'user/is-invalid-port&lt;/h2&gt;
&lt;p&gt;user=&amp;gt; (is-invalid-port 65534)&lt;br&gt;
false&lt;br&gt;
user=&amp;gt; (is-invalid-port 65535) ; should be false!&lt;br&gt;
true&lt;br&gt;
user=&amp;gt; (is-invalid-port 65536)&lt;br&gt;
true&lt;br&gt;
&lt;code&gt;`&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This is corroborated by (link: &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.oracle.com/javase/7/docs/api/java/net/ServerSocket.html#ServerSocket(int)&quot;&gt;https://docs.oracle.com/javase/7/docs/api/java/net/ServerSocket.html#ServerSocket(int)&lt;/a&gt; text: {{ServerSocket}}'s Javadoc):&lt;/p&gt;
&lt;p&gt;{quote}&lt;br&gt;
IllegalArgumentException - if the port parameter is outside the specified range of valid port values, which is between 0 and 65535, inclusive.&lt;br&gt;
{quote}&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Patch:&lt;/strong&gt; port-65535-obo-v2.patch&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Prescreened:&lt;/strong&gt; Alex Miller&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/3356/port-65535-incorrectly-excluded?show=3356#q3356</guid>
<pubDate>Tue, 23 Nov 2021 21:04:00 +0000</pubDate>
</item>
<item>
<title>Commented: Did TDEPS-187 break add-libs?</title>
<link>https://ask.clojure.org/index.php/10936/did-tdeps-187-break-add-libs?show=10939#c10939</link>
<description>Aha! Thanks :D</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10936/did-tdeps-187-break-add-libs?show=10939#c10939</guid>
<pubDate>Fri, 13 Aug 2021 07:36:07 +0000</pubDate>
</item>
<item>
<title>Commented: clj repl crashing when launched and pwd is ~, otherwise from any other directory it's fine</title>
<link>https://ask.clojure.org/index.php/10784/repl-crashing-when-launched-otherwise-from-other-directory?show=10815#c10815</link>
<description>Something to bear in mind... Thanks a lot..&lt;br /&gt;
&lt;br /&gt;
PS:- &lt;a href=&quot;https://stackoverflow.com/questions/68374421/clj-repl-crashing-when-launched-and-pwd-is/68389626#68389626&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://stackoverflow.com/questions/68374421/clj-repl-crashing-when-launched-and-pwd-is/68389626#68389626&lt;/a&gt;</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10784/repl-crashing-when-launched-otherwise-from-other-directory?show=10815#c10815</guid>
<pubDate>Thu, 15 Jul 2021 07:31:47 +0000</pubDate>
</item>
<item>
<title>Answer selected: `source` errors on a function</title>
<link>https://ask.clojure.org/index.php/10657/source-errors-on-a-function?show=10658#a10658</link>
<description>&lt;p&gt;I think we may have this logged somewhere already, has to do with how source macro does not have the ns context to resolve auto-resolved keywords at read time, which is definitely fixable now that we have pluggable resolver in read.&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10657/source-errors-on-a-function?show=10658#a10658</guid>
<pubDate>Wed, 26 May 2021 16:44:13 +0000</pubDate>
</item>
<item>
<title>Closed: Allow reader conditionals in prepl</title>
<link>https://ask.clojure.org/index.php/3342/allow-reader-conditionals-in-prepl?show=3342#q3342</link>
<description>&lt;p&gt;The ClojureScript prepl implementation allows for reader conditionals, the Clojure one does not. Allowing reader conditionals in the Clojure prepl implementation will bring the two implementations in line with each other.&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/3342/allow-reader-conditionals-in-prepl?show=3342#q3342</guid>
<pubDate>Wed, 19 May 2021 19:44:23 +0000</pubDate>
</item>
<item>
<title>Answer selected: Should load-file use the repl's eval function?</title>
<link>https://ask.clojure.org/index.php/10624/should-load-file-use-the-repls-eval-function?show=10625#a10625</link>
<description>&lt;p&gt;The eval function of the current repl is for eval'ing things read by the repl, not all things eval'ed in the runtime. So, no this is not an expectation you should have.&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10624/should-load-file-use-the-repls-eval-function?show=10625#a10625</guid>
<pubDate>Mon, 17 May 2021 21:07:11 +0000</pubDate>
</item>
<item>
<title>Answered: Why does evaluating an eduction cause the reader to fail?</title>
<link>https://ask.clojure.org/index.php/10576/why-does-evaluating-an-eduction-cause-the-reader-to-fail?show=10577#a10577</link>
<description>&lt;p&gt;In general, not every object is eval-able. When eval'ing something like this, a class gets generated that's something like (fn* [] &amp;lt;eduction-object&amp;gt;). To create the class, that eduction object needs to get stored in the bytecode. In this case, the transducer function can't be directly stored in the bytecode - the Compiler in this case makes a hail mary and does a print-dup to a string like &quot;#=(clojure.core$map$fn__596.)&quot; Then that value is attempting to be read back during the eval but the class is not available with that constructor. That's the read error you're seeing. &lt;/p&gt;
&lt;p&gt;It's the same kind of exception you often get when returning objects rather than forms from a macro and in fact you can replicate the error with macros too (this is a common macro error):&lt;/p&gt;
&lt;p&gt;(defmacro foo [] (eduction (map identity) [#'+ 2 3]))&lt;br&gt;
(foo)&lt;/p&gt;
&lt;p&gt;I don't know that I would expect this to work - as you say, eductions are collections, but not seqs or lists.&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10576/why-does-evaluating-an-eduction-cause-the-reader-to-fail?show=10577#a10577</guid>
<pubDate>Tue, 11 May 2021 02:48:55 +0000</pubDate>
</item>
<item>
<title>Answered: What cool things do you do with `clojure.main/repl`?</title>
<link>https://ask.clojure.org/index.php/10425/what-cool-things-do-you-do-with-clojure-main-repl?show=10566#a10566</link>
<description>&lt;p&gt;Doesn't seem to be implemented on top of &lt;code&gt;clojure.main/repl&lt;/code&gt; specifically, but &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/eggsyntax/datawalk&quot;&gt;Datawalk&lt;/a&gt; is a pretty cool example of what you can do with a sub-REPL.&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10425/what-cool-things-do-you-do-with-clojure-main-repl?show=10566#a10566</guid>
<pubDate>Wed, 05 May 2021 11:57:30 +0000</pubDate>
</item>
<item>
<title>Hide Warnings from Com.Google.Cloud.Translate</title>
<link>https://ask.clojure.org/index.php/10092/hide-warnings-from-com-google-cloud-translate</link>
<description>&lt;p&gt;Howdy.  I am using this excellent wrapper over google translate. &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/billwinkler/google-translate&quot;&gt;https://github.com/billwinkler/google-translate&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;However, whenever I invoke &lt;br&gt;
&lt;code&gt;(gt/translate!  ... :from &quot;&quot; :to &quot;&quot;)&lt;/code&gt; &lt;br&gt;
I get warnings printed to the console / REPL.&lt;br&gt;
I would really like to not see these warnings:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;WARNING: Ignoring Application Default Credentials GOOGLE_APPLICATION_CREDENTIALS: using explicit setting for API key instead.&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;I am relatively new to logging and understand the java side of things is a mess, is there any way I can prevent seeing these warnings in the REPL ?&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10092/hide-warnings-from-com-google-cloud-translate</guid>
<pubDate>Tue, 26 Jan 2021 02:38:21 +0000</pubDate>
</item>
<item>
<title>Answered: Why have prompts on previous lines in the clj command-line REPL started disappearing?</title>
<link>https://ask.clojure.org/index.php/10025/have-prompts-previous-lines-command-started-disappearing?show=10026#a10026</link>
<description>&lt;p&gt;This is because the &lt;code&gt;clj&lt;/code&gt; command internally uses the &lt;code&gt;rlwrap&lt;/code&gt; command to provide conventional REPL keyboard shortcuts.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;rlwrap&lt;/code&gt; in turn uses the &lt;code&gt;readline&lt;/code&gt; library, and the latest version of that (8.1) has exposed a bug in &lt;code&gt;rlwrap&lt;/code&gt;, causing the disappearing prompt:&lt;/p&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/hanslub42/rlwrap/issues/108&quot;&gt;https://github.com/hanslub42/rlwrap/issues/108&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Until a fixed release of the &lt;code&gt;rlwrap&lt;/code&gt; command is available, this bug can be worked around by adding the following to an &lt;code&gt;.inputrc&lt;/code&gt; file in your home directory (i.e. &lt;code&gt;~/.inputrc&lt;/code&gt; — create it if it doesn't already exist)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$if clojure
    set enable-bracketed-paste off
$endif
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If exiting and restarting the &lt;code&gt;clj&lt;/code&gt; command isn't enough for that new configuration to be picked up, try restarting your terminal too.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; &lt;code&gt;rlwrap&lt;/code&gt; version 0.44 has been released, making the workaround described above no longer needed. &lt;a rel=&quot;nofollow&quot; href=&quot;https://repology.org/project/rlwrap/versions&quot;&gt;See here&lt;/a&gt; for which version of &lt;code&gt;rlwrap&lt;/code&gt; is available in various package repositories.&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10025/have-prompts-previous-lines-command-started-disappearing?show=10026#a10026</guid>
<pubDate>Thu, 07 Jan 2021 15:21:20 +0000</pubDate>
</item>
<item>
<title>Answered: Problem whilst requiring clojure clojure.data.csv :as csv</title>
<link>https://ask.clojure.org/index.php/10011/problem-whilst-requiring-clojure-clojure-data-csv-as-csv?show=10019#a10019</link>
<description>&lt;p&gt;Asked and answered on StackOverflow: &lt;a rel=&quot;nofollow&quot; href=&quot;https://stackoverflow.com/questions/65543714/problems-while-creating-a-deps-edn-file&quot;&gt;https://stackoverflow.com/questions/65543714/problems-while-creating-a-deps-edn-file&lt;/a&gt; (so folks can read some history of the issue and what has already been suggested).&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10011/problem-whilst-requiring-clojure-clojure-data-csv-as-csv?show=10019#a10019</guid>
<pubDate>Tue, 05 Jan 2021 23:35:59 +0000</pubDate>
</item>
<item>
<title>Answered: database updates executed with lein repl, but not with lein run</title>
<link>https://ask.clojure.org/index.php/9882/database-updates-executed-with-lein-repl-but-not-with-lein-run?show=9886#a9886</link>
<description>&lt;p&gt;map is lazy.  You will probably get better results if you wrap the &lt;code&gt;(map ...)&lt;/code&gt; call inside of a &lt;code&gt;(doall (map ...))&lt;/code&gt; call, or if you use &lt;code&gt;mapv&lt;/code&gt; (which is eager) instead of &lt;code&gt;map&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Note that in a REPL, the P (Print) part of REPL will force a lazy return value from map to be fully evaluated so that it can be printed.&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/9882/database-updates-executed-with-lein-repl-but-not-with-lein-run?show=9886#a9886</guid>
<pubDate>Fri, 27 Nov 2020 15:33:27 +0000</pubDate>
</item>
<item>
<title>Answered: Change in behavior of default javadoc `*feeling-lucky-url*` due to google change</title>
<link>https://ask.clojure.org/index.php/9752/change-behavior-default-javadoc-feeling-lucky-google-change?show=9771#a9771</link>
<description>&lt;p&gt;Logged as &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2589&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2589&lt;/a&gt;&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/9752/change-behavior-default-javadoc-feeling-lucky-google-change?show=9771#a9771</guid>
<pubDate>Mon, 09 Nov 2020 15:59:29 +0000</pubDate>
</item>
<item>
<title>Answered: REPL seems not to work</title>
<link>https://ask.clojure.org/index.php/9757/repl-seems-not-to-work?show=9763#a9763</link>
<description>&lt;p&gt;I'm not sure why you would see this - have never seen an issue like this in the past. If you are still having this issue, try Ctrl-\ to get a stack dump and attach the result here.&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/9757/repl-seems-not-to-work?show=9763#a9763</guid>
<pubDate>Sun, 08 Nov 2020 22:48:55 +0000</pubDate>
</item>
<item>
<title>Answered: Can you specify the location .nrepl-port file is written to?</title>
<link>https://ask.clojure.org/index.php/9691/can-you-specify-the-location-nrepl-port-file-is-written-to?show=9700#a9700</link>
<description>&lt;p&gt;Not a nrepl expert, but with a search about &quot;nrepl-port&quot; in github.com/nrepl/nrepl i find this:&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/nrepl/nrepl/blob/933e08b7ef0a66002bf5bf6369088515e1c4b42f/src/clojure/nrepl/cmdline.clj#L420&quot;&gt;https://github.com/nrepl/nrepl/blob/933e08b7ef0a66002bf5bf6369088515e1c4b42f/src/clojure/nrepl/cmdline.clj#L420&lt;/a&gt;&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/9691/can-you-specify-the-location-nrepl-port-file-is-written-to?show=9700#a9700</guid>
<pubDate>Fri, 09 Oct 2020 17:23:38 +0000</pubDate>
</item>
<item>
<title>how to require clojure libs as classes instead of clj file to reduce repl start up time during development?</title>
<link>https://ask.clojure.org/index.php/9681/require-clojure-classes-instead-reduce-during-development</link>
<description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;i read about &lt;a rel=&quot;nofollow&quot; href=&quot;http://%20https://clojure.org/guides/dev_startup_time&quot;&gt;reducing repl start up time during dev&lt;/a&gt;  and tried to apply these knowledge to start REPL using Leiningen (in the article Alex shows this practice using deps.edn).&lt;/p&gt;
&lt;p&gt;My steps:&lt;/p&gt;
&lt;p&gt;I overrided clojure.core/load var to track time elapsed on loading module with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(alter-var-root #'clojure.core/load (fn [origin-fn]
                                  (if (get (meta origin-fn) ::track-load?)
                                    origin-fn
                                    (vary-meta (fn [&amp;amp; args]
                                                 (let [start# (System/nanoTime)
                                                       ret# (apply origin-fn args)
                                                       elapsed-ms# (/ (double (- (System/nanoTime) start#)) 1000000.0)]
                                                   (newline)
                                                   (pr {:args (vec args)
                                                        :ms   elapsed-ms#})
                                                   (newline)
                                                   ret#))
                                               merge
                                               {::track-load? true}))))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I noticed that loading core clojure parts takes time ~0.10-0.20 ms and loading third party libs modules (cheshire for example) , takes ~200-400ms.&lt;/p&gt;
&lt;p&gt;As i understand,  main idea of reducing REPL start up time  is the priority of compiled class before clj module if  clj module was not changed. So we can compile third party libs and get benefit of not parsing their clj files but use their compiled classes.&lt;/p&gt;
&lt;p&gt;I compiled all clojure files (my and libs) via leiningen uberjar and added folder with compiled class files to :checkout-deps-shares, i guess it is a way to add folder with class files to classpath:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:checkout-deps-shares [:source-paths :test-paths
                     ~(fn [p] (str (:root p) &quot;/target/uberjar/classes/*&quot;))]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then i restarted repl, overrided clojure.core/load to track modules load time and as experiment do following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(time (require 'runtime.account :reload-all))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;where runtime.account is one of my root modules.&lt;/p&gt;
&lt;p&gt;As a result i cannot see any difference in loading time of third party libs modules :/.&lt;/p&gt;
&lt;p&gt;Maybe you can give me some details about mechanism deciding to load class file or clj file and some way to monitor that activity?&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/9681/require-clojure-classes-instead-reduce-during-development</guid>
<pubDate>Sat, 03 Oct 2020 07:32:25 +0000</pubDate>
</item>
<item>
<title>Lein repl error: As of 2.8.2, the repl task is incompatible with Clojure versions older than 1.7.0.</title>
<link>https://ask.clojure.org/index.php/9599/lein-repl-error-incompatible-with-clojure-versions-older-than</link>
<description>&lt;p&gt;I am trying to work through an example in the Clojure Workshop. I created a folder and in that included the following &lt;code&gt;project.clj&lt;/code&gt; file.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defproject learncsv &quot;1.0.0-SNAPSHOT&quot;
 :dependencies [[org.clojure/data.csv &quot;1.0.0&quot;]
             [semantic-csv &quot;0.2.1-alpha1&quot;]])
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then, I went to the terminal and typed &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;lein repl
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I got the following error:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated 

in JDK 13 and will likely be removed in a future release.
As of 2.8.2, the repl task is incompatible with Clojure versions older than 1.7.0.
You can downgrade to 2.8.1 or use `lein trampoline run -m clojure.main` for a simpler 
 fallback repl.
Subprocess failed (exit code: 1)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I am super new to clojure. Never included any dependencies. Would really appreciate any help. &lt;/p&gt;
&lt;p&gt;Edit: If I run &lt;code&gt;lein repl&lt;/code&gt; in a folder that does not have any project.clj then it starts fine. And, it shows my clojure version as 1.10. So I am not sure why the error seems to suggest that I am using Clojure version older than 1.7.0&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/9599/lein-repl-error-incompatible-with-clojure-versions-older-than</guid>
<pubDate>Fri, 11 Sep 2020 23:06:45 +0000</pubDate>
</item>
<item>
<title>Cartesian Product of a Single linked list</title>
<link>https://ask.clojure.org/index.php/9225/cartesian-product-of-a-single-linked-list</link>
<description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I have a task to write a function which prints a cartesian product of a single linked list.&lt;br&gt;
This is what my lecturer gave us and it works perfectly,but I just don't understand how they work. More specifically I can't figure out (func (:data node)) this line. I know that it gives us data of the node but what is func doing?&lt;br&gt;
The slist-cartesian function is totally confusing for me.&lt;br&gt;
Please explain to me how they work.&lt;br&gt;
Thank you!&lt;/p&gt;
&lt;p&gt;(defn slist-iter [lst func]&lt;br&gt;
  (loop [node (deref (:head lst))]&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(if (not (nil? node))
  (do
    (func (:data node))
    (recur (deref (:next node)))))))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(defn slist-cartesian [lst]&lt;br&gt;
  (slist-iter&lt;br&gt;
   lst&lt;br&gt;
   (fn [x]&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; (slist-iter
  lst
  (fn [y]
    (println x y))))))
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/9225/cartesian-product-of-a-single-linked-list</guid>
<pubDate>Fri, 10 Apr 2020 23:35:11 +0000</pubDate>
</item>
<item>
<title>How should I decide whether to apply file/line metadata</title>
<link>https://ask.clojure.org/index.php/8903/how-should-i-decide-whether-to-apply-file-line-metadata</link>
<description>&lt;p&gt;It's quite difficult when writing REPL client tooling to know whether it's safe to attach the &lt;code&gt;clojure.core/eval-file&lt;/code&gt; and &lt;code&gt;clojure.core/line&lt;/code&gt; metadata to the forms being sent.  You can make an approximation based on the start character, but it doesn't seem like a reliable approach to this problem.&lt;/p&gt;
&lt;p&gt;An example of where the metadata fails is if you're sending a number or string to be evaluated.&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8903/how-should-i-decide-whether-to-apply-file-line-metadata</guid>
<pubDate>Tue, 26 Nov 2019 09:59:27 +0000</pubDate>
</item>
<item>
<title>remote-prepl blocks main-thread upon in-reader's eos</title>
<link>https://ask.clojure.org/index.php/4230/remote-prepl-blocks-main-thread-upon-in-readers-eos</link>
<description>When the in-reader passed to {{clojure.core.server/remote-prepl}} reaches end-of-stream, an attempt is made to close the socket's reader. This however blocks the main-thread as (mostly) the socket is still being read from.&lt;br /&gt;
&lt;br /&gt;
{code:none}&lt;br /&gt;
$ clj -J-Dclojure.server.jvm=&amp;quot;{:port 5555 :accept clojure.core.server/io-prepl}&amp;quot; -r&lt;br /&gt;
Clojure 1.10.0&lt;br /&gt;
user=&amp;gt; (clojure.core.server/remote-prepl &amp;quot;127.0.0.1&amp;quot; 5555 *in* prn)&lt;br /&gt;
;; as expected:&lt;br /&gt;
1&lt;br /&gt;
{:tag :ret, :val 1, :ns &amp;quot;user&amp;quot;, :ms 0, :form &amp;quot;1&amp;quot;}&lt;br /&gt;
^D ;; hangs - ^C required to exit process&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What I would expect to happen in this case is that upon {{^D}} the initial repl re-appears (similar to how {{(clojure.core.server/io-prepl)}} behaves).&lt;br /&gt;
&lt;br /&gt;
What does work:&lt;br /&gt;
{code:none}&lt;br /&gt;
$ clj -J-Dclojure.server.jvm=&amp;quot;{:port 5555 :accept clojure.core.server/io-prepl}&amp;quot; -r&lt;br /&gt;
Clojure 1.10.0&lt;br /&gt;
user=&amp;gt; (clojure.core.server/remote-prepl &amp;quot;127.0.0.1&amp;quot; 5555 *in* prn)&lt;br /&gt;
:repl/quit&lt;br /&gt;
^D&lt;br /&gt;
nil&lt;br /&gt;
user=&amp;gt; _&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Looking at the code though it seems that this is not the intented way to terminate the prepl.</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/4230/remote-prepl-blocks-main-thread-upon-in-readers-eos</guid>
<pubDate>Fri, 10 May 2019 15:00:21 +0000</pubDate>
</item>
<item>
<title>Add switch for `clojure --version`</title>
<link>https://ask.clojure.org/index.php/3792/add-switch-for-clojure-version</link>
<description>Clojure should support the `--version` and `-v` switches that are nearly universal among software tools. &amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Suggested output is EDN format:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;{:version {:clojure &amp;quot;1.10.1-beta1&amp;quot; :java &amp;quot;Java 12&amp;quot;}}</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/3792/add-switch-for-clojure-version</guid>
<pubDate>Wed, 08 May 2019 17:46:59 +0000</pubDate>
</item>
<item>
<title>Support fully qualified Symbol for clojure.main -m</title>
<link>https://ask.clojure.org/index.php/4250/support-fully-qualified-symbol-for-clojure-main-m</link>
<description>&lt;p&gt;Given the new tools.deps CLI capabilities it would be very convenient to have a {{clojure.main -m}} option that optionally allows calling specific function, not just {{-main}}.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;;; calling main
clojure -m some.util args ...
;; calling other fns
clojure -m some.util/task args ...
clojure -m some.util/another-task args ...&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;`&lt;/code&gt;&lt;br&gt;
(ns some.util)&lt;/p&gt;
&lt;p&gt;(defn -main [&amp;amp; args] ...)&lt;br&gt;
(defn task [&amp;amp; args] ...)&lt;br&gt;
(defn another-task [&amp;amp; args] ...)&lt;br&gt;
&lt;code&gt;`&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Creating utilities for use with the {{clojure}} tool otherwise requires creating a new namespace for each &quot;task&quot; (or resorting to {{-e}} or {{script.clj}} files).&lt;/p&gt;
&lt;p&gt;Leiningen supports the {{lein run -m some.util/task ...}} notation. shadow-cljs does as well.&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/4250/support-fully-qualified-symbol-for-clojure-main-m</guid>
<pubDate>Wed, 24 Jan 2018 15:56:09 +0000</pubDate>
</item>
<item>
<title>Update `clj` REPL with hint:  (use Ctrl-D to exit)</title>
<link>https://ask.clojure.org/index.php/3804/update-clj-repl-with-hint-use-ctrl-d-to-exit</link>
<description>&lt;p&gt;Update clojure.main REPL for the &lt;code&gt;clj&lt;/code&gt; tool with a hint for terminating the session via Ctrl-D, like so (changes in bold):&lt;/p&gt;
&lt;p&gt;~ &amp;gt; clj&lt;br&gt;
Clojure 1.9.0 &lt;strong&gt;(use Ctrl-D to exit)&lt;/strong&gt; &lt;br&gt;
user=&amp;gt;&lt;br&gt;
~ &amp;gt; &lt;/p&gt;
&lt;p&gt;The lein repl accepts &lt;code&gt;exit&lt;/code&gt;, &lt;code&gt;quit&lt;/code&gt;, and Crtl-D to exit; the &lt;code&gt;clj&lt;/code&gt; repl accepts only Crtl-D. A small hint upon startup on the proper way to terminate the repl session will smooth the experience for users expecting for their old habits to work.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Patch:&lt;/strong&gt; clj-2286.patch&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/3804/update-clj-repl-with-hint-use-ctrl-d-to-exit</guid>
<pubDate>Mon, 11 Dec 2017 22:12:01 +0000</pubDate>
</item>
<item>
<title>Allow runtime modification of REPL exception handling</title>
<link>https://ask.clojure.org/index.php/4634/allow-runtime-modification-of-repl-exception-handling</link>
<description>&lt;h4&gt;Problem Statement&lt;/h4&gt;
&lt;p&gt;Clojure's REPL is capable of paramterizing almost every aspect of its functionality, including how uncaught exceptions are printed. In the current implementation, these customization hooks are passed in as arguments and closed over, meaning that they &lt;em&gt;cannot&lt;/em&gt; be changed once the REPL is started.&lt;/p&gt;
&lt;p&gt;Many development tools want to override how the REPL handles uncaught errors. Examples of useful customizations include (but are not limited to):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Formatted exception messages (including whitespace and ANSI coloring)&lt;/li&gt;
&lt;li&gt;Alternative representations for certain types of exceptions (e.g, Spec errors) &lt;/li&gt;
&lt;li&gt;Dropping into a graphical interaction mode to better inspect ex-data.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Currently, this type of customization must be applied before a REPL is started, meaning that changing how a REPL displays errors requires support from (or plugins to) a third-party tool such as Boot or Leiningen.&lt;/p&gt;
&lt;h4&gt;Alternatives&lt;/h4&gt;
&lt;p&gt;&amp;lt;BR/&amp;gt;&lt;br&gt;
1. &lt;strong&gt;Take no action&lt;/strong&gt;. &lt;/p&gt;
&lt;p&gt;Third-party tool support is required to create customized exception handling in the REPL. Tools have different techniques for doing this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;nREPL can intercept the exception on the wire and passes it through middleware&lt;/li&gt;
&lt;li&gt;Leiningen plugins alter the root binding of {{clojure.main/repl-caught}}.&lt;/li&gt;
&lt;li&gt;Boot allows users to build a task to invoke {{clojure.main/repl}} with the desired arguments.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Users will continue to select one of these according to their tooling preferences.&lt;/p&gt;
&lt;p&gt;Benefits:&lt;br&gt;
  1. No effort or changes to the existing code.&lt;/p&gt;
&lt;p&gt;Tradeoffs:&lt;br&gt;
  1. Tools will continue to implement their own diverse, sometimes hacky techniques for printing custom exceptions.&lt;br&gt;
  2. Any library intended to provide alternative exception handling will be tied to a specific launcher tool.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Make the REPL exception handler dynamically rebindable&lt;/strong&gt; &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If the REPL exception handler were a dynamic, thread-local var, users and libraries could change the behavior of the currently running REPL.&lt;/p&gt;
&lt;p&gt;Benefits: &lt;br&gt;
  1. Users and libraries can freely override how exceptions are printed, regardless of how Clojure was launched.&lt;br&gt;
  2. Fully backwards compatible with existing tools.&lt;/p&gt;
&lt;p&gt;Tradeoffs:&lt;br&gt;
  1. It will be possible for library authors to provide &quot;bad&quot; or poorly reasoned error printers. This is still possible with launch tools, but the barrier of entry is even lower with libraries.&lt;/p&gt;
&lt;p&gt;The attached patch implements this option.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Encourage users to start new REPLs instead&lt;/strong&gt; &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In many Clojure environments, it's possible to explicitly launch a REPL from within another REPL. This sub-REPL could have the desired :caught hook.&lt;/p&gt;
&lt;p&gt;Benefits:&lt;br&gt;
  1. No effort or changes to the existing code.&lt;br&gt;
  2. &quot;Functionally pure&quot;, and in alignment with the evident design of the current REPL.&lt;/p&gt;
&lt;p&gt;Tradeoffs:&lt;br&gt;
  1. There is a non-trivial subset of Clojure developers who do not know exactly how REPLs work. They are likely to be confused or subject to increased cognitive load. Insofar as this set of beginner/intermediate developers are precisely who enhanced error messages are meant to help in the first place, this solution is counterproductive.&lt;br&gt;
  2. For better or for worse, many existing and widely used tools do not support this. This does not work at all in nREPL, for example. However, even the simplest command-line REPLs behavior would change for the worse; sending a EOF (accidentally or otherwise) would always kill the sub-REPL with no feedback as to what just happened.&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/4634/allow-runtime-modification-of-repl-exception-handling</guid>
<pubDate>Tue, 11 Oct 2016 16:20:45 +0000</pubDate>
</item>
<item>
<title>New socket server startup proactively loads too much code, slowing boot time</title>
<link>https://ask.clojure.org/index.php/2812/socket-server-startup-proactively-loads-much-code-slowing</link>
<description>&lt;p&gt;In the new socket server code, clojure.core.server is proactively loaded (regardless of whether servers are in the config), which will also load clojure.edn and clojure.string.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Approach:&lt;/strong&gt; Delay loading of this code until the first server config is found. This improves startup time when not using the socket server about 0.05 s.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Patch:&lt;/strong&gt; clj-1891.patch&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/2812/socket-server-startup-proactively-loads-much-code-slowing</guid>
<pubDate>Tue, 09 Feb 2016 13:11:33 +0000</pubDate>
</item>
<item>
<title>Expose clojure.repl/doc as a function call</title>
<link>https://ask.clojure.org/index.php/1939/expose-clojure-repl-doc-as-a-function-call</link>
<description>&lt;p&gt;Restructure the printing function {{clojure.repl/doc}} so that it calls a fuction {{clojure.repl/doc-fn}} for its data - in the same way as {{dir}} calls {{dir-fn}}.  Make {{doc-fn}} public so that it can be called directly and allow developers to parse and display the data as needed.&lt;/p&gt;
&lt;p&gt;Use case: I am making a namespace inspector (using JavaFX) (somewhat like the Swing-based tree-inspector in Clojure), and when getting a function, I would like to display the same meta-information as &quot;doc&quot; prints in the REPL - including the special forms data coded in a private var/map in Clojure.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Patch:&lt;/strong&gt; doc-fn.patch&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/1939/expose-clojure-repl-doc-as-a-function-call</guid>
<pubDate>Wed, 28 Oct 2015 18:29:20 +0000</pubDate>
</item>
<item>
<title>repl value of *file* is &quot;NO_SOURCE_PATH&quot;, of *source-path* is &quot;NO_SOURCE_FILE&quot;</title>
<link>https://ask.clojure.org/index.php/1920/repl-value-file-nosourcepath-source-path-nosourcefile</link>
<description>&lt;p&gt;repl value of &lt;code&gt;*file*&lt;/code&gt; is &quot;NO_SOURCE_PATH&quot;, of &lt;code&gt;*source-path*&lt;/code&gt; is &quot;NO_SOURCE_FILE&quot;&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/1920/repl-value-file-nosourcepath-source-path-nosourcefile</guid>
<pubDate>Tue, 19 Feb 2013 22:22:10 +0000</pubDate>
</item>
</channel>
</rss>