<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Recent questions and answers in REPL</title>
<link>https://ask.clojure.org/index.php/qa/clojure/repl</link>
<description></description>
<item>
<title>Answered: 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=14858#a14858</link>
<description>&lt;p&gt;Updating the version of &lt;code&gt;rlwrap&lt;/code&gt; by building it from source fixed the issue.&lt;/p&gt;
&lt;p&gt;The version installed on my FreeBSD system was 0.45, the latest version available for the package manager, building from source yielded version 0.48, which seems to have fixed the display bug :)&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14848/why-does-repl-incorrectly-display-command-after-press-enter?show=14858#a14858</guid>
<pubDate>Tue, 23 Dec 2025 08:15:40 +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>Answered: 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=14398#a14398</link>
<description>&lt;p&gt;Logged as &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2897&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2897&lt;/a&gt; - thanks!&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14374/using-remote-prepl-server-false-preventing-related-functions?show=14398#a14398</guid>
<pubDate>Wed, 19 Feb 2025 21:30:58 +0000</pubDate>
</item>
<item>
<title>Answered: 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 18:22:17 +0000</pubDate>
</item>
<item>
<title>Answered: prepl could have IDs for requests/responses</title>
<link>https://ask.clojure.org/index.php/13934/prepl-could-have-ids-for-requests-responses?show=13935#a13935</link>
<description>&lt;p&gt;Output and error are streams and not tied to any particular request - there is no general way to correlate these, so no that does not seem like a good idea.&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13934/prepl-could-have-ids-for-requests-responses?show=13935#a13935</guid>
<pubDate>Sun, 02 Jun 2024 18:53:25 +0000</pubDate>
</item>
<item>
<title>Answered: 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=13789#a13789</link>
<description>&lt;p&gt;You don't need &lt;code&gt;eval&lt;/code&gt; for this (which also isn't insecure in your context since you control all that's actually being &lt;code&gt;eval&lt;/code&gt;ed):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(let [data (vec (range 10))]
  (dotimes [idx (count data)]
    (intern *ns* (symbol (str &quot;x&quot; idx)) (nth data idx))))

=&amp;gt; x5
5
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But, instead of doing things like this, I would strongly suggest &lt;code&gt;tap&amp;gt;&lt;/code&gt;ing that data and using tools like Portal, Reveal, REBL. Incomparably more convenient than browsing complex nested data in a plain text REPL.&lt;/p&gt;
</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=13789#a13789</guid>
<pubDate>Sat, 16 Mar 2024 22:10:10 +0000</pubDate>
</item>
<item>
<title>Answered: 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=13763#a13763</link>
<description>&lt;p&gt;Seems like this may be same issue as &lt;a rel=&quot;nofollow&quot; href=&quot;https://ask.clojure.org/index.php/10735/prepl-warnings-remain-buffered-until-explicit-flushing-client&quot;&gt;https://ask.clojure.org/index.php/10735/prepl-warnings-remain-buffered-until-explicit-flushing-client&lt;/a&gt; ?&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13760/create-short-lived-remote-prepl-such-that-gracefully-shutdown?show=13763#a13763</guid>
<pubDate>Tue, 27 Feb 2024 17:36:45 +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>Answered: 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=13055#a13055</link>
<description>&lt;p&gt;Created &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2788&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2788&lt;/a&gt;&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=13055#a13055</guid>
<pubDate>Mon, 03 Jul 2023 13:50:56 +0000</pubDate>
</item>
<item>
<title>Answered: 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=12979#a12979</link>
<description>&lt;p&gt;This is covered in &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2769&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2769&lt;/a&gt; and will be fixed in the next alpha.&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=12979#a12979</guid>
<pubDate>Tue, 30 May 2023 16:44:56 +0000</pubDate>
</item>
<item>
<title>Answered: 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 01:22:28 +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>Answered: 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>Fri, 23 Dec 2022 14:48:31 +0000</pubDate>
</item>
<item>
<title>Answered: 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=12354#a12354</link>
<description>&lt;p&gt;RT is an internal implementation class. &lt;/p&gt;
&lt;p&gt;The Java API for Clojure is &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.github.io/clojure/javadoc/clojure/java/api/package-summary.html&quot;&gt;https://clojure.github.io/clojure/javadoc/clojure/java/api/package-summary.html&lt;/a&gt;. &lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12353/could-locate-clojure-coreinit-clojure-clojure-classpath?show=12354#a12354</guid>
<pubDate>Tue, 01 Nov 2022 14:16:34 +0000</pubDate>
</item>
<item>
<title>Answered: 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=12182#a12182</link>
<description>&lt;p&gt;Logged as &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2722&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2722&lt;/a&gt;&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12171/add-function-that-returns-every-interned-keyword-the-runtime?show=12182#a12182</guid>
<pubDate>Thu, 08 Sep 2022 12:07:18 +0000</pubDate>
</item>
<item>
<title>Answered: 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=11825#a11825</link>
<description>&lt;p&gt;Here is a patch. I don't have another way to contribute this.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;From 52fe3111bf0f8f769121bdc2c383a3f11aac695f Mon Sep 17 00:00:00 2001
From: Ray McDermott &amp;lt;ray.mcdermott@opengrail.com&amp;gt;
Date: Tue, 26 Apr 2022 21:52:21 +0200
Subject: [PATCH] Fix for #CLJ-2645

---
 src/clj/clojure/core/server.clj |  4 ++--
 src/clj/clojure/core_print.clj  | 41 ++++++++++++++++++---------------
 2 files changed, 24 insertions(+), 21 deletions(-)

diff --git a/src/clj/clojure/core/server.clj b/src/clj/clojure/core/server.clj
index 3cda4d1f74..c774cab3b5 100644
--- a/src/clj/clojure/core/server.clj
+++ b/src/clj/clojure/core/server.clj
@@ -220,8 +220,8 @@
     (m/with-bindings
       (in-ns 'user)
       (binding [*in* (or stdin in-reader)
-                *out* (PrintWriter-on #(out-fn {:tag :out :val %1}) nil)
-                *err* (PrintWriter-on #(out-fn {:tag :err :val %1}) nil)]
+                *out* (PrintWriter-on #(out-fn {:tag :out :val %1}) nil true)
+                *err* (PrintWriter-on #(out-fn {:tag :err :val %1}) nil true)]
         (try
           (add-tap tapfn)
           (loop []
diff --git a/src/clj/clojure/core_print.clj b/src/clj/clojure/core_print.clj
index 18c5101c1d..4f10b780a1 100644
--- a/src/clj/clojure/core_print.clj
+++ b/src/clj/clojure/core_print.clj
@@ -559,23 +559,26 @@
 (defn ^java.io.PrintWriter PrintWriter-on
   &quot;implements java.io.PrintWriter given flush-fn, which will be called
   when .flush() is called, with a string built up since the last call to .flush().
-  if not nil, close-fn will be called with no arguments when .close is called&quot;
+  if not nil, close-fn will be called with no arguments when .close is called.
+  autoflush? determines if the PrintWriter will autoflush, false by default.&quot;
   {:added &quot;1.10&quot;}
-  [flush-fn close-fn]
-  (let [sb (StringBuilder.)]
-    (-&amp;gt; (proxy [Writer] []
-          (flush []
-                 (when (pos? (.length sb))
-                   (flush-fn (.toString sb)))
-                 (.setLength sb 0))
-          (close []
-                 (.flush ^Writer this)
-                 (when close-fn (close-fn))
-                 nil)
-          (write [str-cbuf off len]
-                 (when (pos? len)
-                   (if (instance? String str-cbuf)
-                     (.append sb ^String str-cbuf ^int off ^int len)
-                     (.append sb ^chars str-cbuf ^int off ^int len)))))
-        java.io.BufferedWriter.
-        java.io.PrintWriter.)))
+  ([flush-fn close-fn]
+   (PrintWriter-on flush-fn close-fn false))
+  ([flush-fn close-fn autoflush?]
+   (let [sb (StringBuilder.)]
+     (-&amp;gt; (proxy [Writer] []
+           (flush []
+             (when (pos? (.length sb))
+               (flush-fn (.toString sb)))
+             (.setLength sb 0))
+           (close []
+             (.flush ^Writer this)
+             (when close-fn (close-fn))
+             nil)
+           (write [str-cbuf off len]
+             (when (pos? len)
+               (if (instance? String str-cbuf)
+                 (.append sb ^String str-cbuf ^int off ^int len)
+                 (.append sb ^chars str-cbuf ^int off ^int len)))))
+         java.io.BufferedWriter.
+         (java.io.PrintWriter. ^boolean autoflush?)))))
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10735/prepl-warnings-remain-buffered-until-explicit-flushing-client?show=11825#a11825</guid>
<pubDate>Tue, 26 Apr 2022 20:14:39 +0000</pubDate>
</item>
<item>
<title>Answered: 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=11813#a11813</link>
<description>&lt;p&gt;This shadowing warning mirrors the Clojure behavior no?&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11808/prepl-only-issues-referral-warnings-once-is-that-right?show=11813#a11813</guid>
<pubDate>Tue, 26 Apr 2022 13:03:57 +0000</pubDate>
</item>
<item>
<title>Answered: 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=11582#a11582</link>
<description>&lt;p&gt;Hi I extended CIDER and clojure-mode to work well exactly in this manner. You're right that the eval functions you are looking at are trying to show their results in the source buffer which is useful in some situations but the repl offers a lot more.&lt;/p&gt;
&lt;p&gt;There is a keybinding &lt;code&gt;C-c C-j&lt;/code&gt; which points at the &lt;code&gt;cider-insert-commands-map&lt;/code&gt;. Here you'll find&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;C-c C-j e&lt;/code&gt; : &lt;code&gt;cider-insert-last-sexp-in-repl&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C-c C-j d&lt;/code&gt;: &lt;code&gt;cider-insert-defun-in-repl&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C-c C-j r&lt;/code&gt;: &lt;code&gt;cider-insert-region-in-repl&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C-c C-j n&lt;/code&gt;: &lt;code&gt;cider-insert-ns-form-in-repl&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The important ones here are &lt;code&gt;e&lt;/code&gt; and &lt;code&gt;d&lt;/code&gt; for last form and top-level form. These will send the forms to the repl. But there are some config that need to be set.&lt;/p&gt;
&lt;p&gt;By default, this workflow puts the forms in the repl and anticipates you to keep typing. But we want to not put focus there and send the form to the repl to evaluate. So we want to set two options:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(setq cider-switch-to-repl-on-insert nil)
(setq cider-invert-insert-eval-p t)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;the first option says we don't want to put the focus in the repl, keep the point (emacs lingo for the cursor) where it currently is. The second option is how we tell CIDER that we don't want to keep typing and modify the form, just eval it.&lt;/p&gt;
&lt;p&gt;there's only one thing left to do. When sending the top level form with &lt;code&gt;C-c C-j d&lt;/code&gt;, by default, CIDER might send the whole top level form&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(comment
  (map inc (range 3))
  )
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But we want to modify what is considered a top level form and when in the comment form consider &lt;code&gt;(map inc (range 3))&lt;/code&gt; a top level form, not the whole &lt;code&gt;comment&lt;/code&gt; form. This is remedied by&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(setq clojure-toplevel-inside-comment-form t)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now you can send the top level form from anywhere inside of the &lt;code&gt;(map inc (range 3))&lt;/code&gt; and it will send the top level form you mean rather than the whole &lt;code&gt;comment&lt;/code&gt; form.&lt;/p&gt;
</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=11582#a11582</guid>
<pubDate>Mon, 14 Feb 2022 15:52:46 +0000</pubDate>
</item>
<item>
<title>Answered: 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>Thu, 27 Jan 2022 22:34:16 +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>Answered: 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=11387#a11387</link>
<description>&lt;p&gt;For a given namespace, you can get the full path to the resource it will be (or was) loaded from.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;user=&amp;gt; (clojure.java.io/resource &quot;clojure/core.clj&quot;)
#object[java.net.URL 0x59221b97 &quot;jar:file:/home/justin/.m2/repository/org/clojure/clojure/1.10.1/clojure-1.10.1.jar!/clojure/core.clj&quot;]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will include the version of the package in the jar name (or else reveal the file path from which the code would be loaded).&lt;/p&gt;
</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=11387#a11387</guid>
<pubDate>Mon, 13 Dec 2021 04:14:49 +0000</pubDate>
</item>
<item>
<title>Answered: Did TDEPS-187 break add-libs?</title>
<link>https://ask.clojure.org/index.php/10936/did-tdeps-187-break-add-libs?show=10937#a10937</link>
<description>&lt;p&gt;I think I would rephrase to say TDEPS-187 revealed how add-libs use of calc-basis was already broken. :)  &lt;/p&gt;
&lt;p&gt;I just updated add-libs to correct that in 83a477b305839c697666401508c395cfed29506a - that should help.&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10936/did-tdeps-187-break-add-libs?show=10937#a10937</guid>
<pubDate>Thu, 12 Aug 2021 15:17:05 +0000</pubDate>
</item>
<item>
<title>Answered: 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=10807#a10807</link>
<description>&lt;p&gt;Do you have a &lt;code&gt;src&lt;/code&gt; folder in &lt;code&gt;~&lt;/code&gt;? If so, what it is in it? (I'm wondering if you have &lt;code&gt;src/user.clj&lt;/code&gt; and something in that script is causing the crash)&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10784/repl-crashing-when-launched-otherwise-from-other-directory?show=10807#a10807</guid>
<pubDate>Wed, 14 Jul 2021 23:07:24 +0000</pubDate>
</item>
<item>
<title>Answered: `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 15:04:26 +0000</pubDate>
</item>
<item>
<title>Answered: 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:06:31 +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>Answered: 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=10435#a10435</link>
<description>&lt;p&gt;Logged as &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2620&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2620&lt;/a&gt;&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=10435#a10435</guid>
<pubDate>Thu, 08 Apr 2021 17:04:28 +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>Allow reader conditionals in prepl</title>
<link>https://ask.clojure.org/index.php/3342/allow-reader-conditionals-in-prepl</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</guid>
<pubDate>Mon, 10 Dec 2018 16:43:30 +0000</pubDate>
</item>
<item>
<title>Port 65535 incorrectly excluded</title>
<link>https://ask.clojure.org/index.php/3356/port-65535-incorrectly-excluded</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</guid>
<pubDate>Fri, 17 Aug 2018 01:05:26 +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>