<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Recent questions in Contrib libs</title>
<link>https://ask.clojure.org/index.php/questions/contrib-libs</link>
<description></description>
<item>
<title>Is the recent change to flow's futurize safe?</title>
<link>https://ask.clojure.org/index.php/14994/is-the-recent-change-to-flows-futurize-safe</link>
<description>&lt;p&gt;Previously flow's futurize would rethrow any exceptions thrown by the function when deref'ed. With the recent changes to return a CompletableFuture it no longer does that and instead if the function throws deref'ing will just hang forever.&lt;/p&gt;
</description>
<category>core.async</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14994/is-the-recent-change-to-flows-futurize-safe</guid>
<pubDate>Tue, 17 Mar 2026 15:54:00 +0000</pubDate>
</item>
<item>
<title>tools.cli: capture unrecognized options as unparsed arguments</title>
<link>https://ask.clojure.org/index.php/14977/tools-cli-capture-unrecognized-options-unparsed-arguments</link>
<description>&lt;p&gt;I frequently write a command that accepts options and in turn execute a shell command passing arguments through; I want to be able to specify additional arguments to that shell command.&lt;/p&gt;
&lt;p&gt;In tools.cli, the :in-order key &lt;em&gt;almost&lt;/em&gt; does what i want:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;`&lt;/code&gt;&lt;br&gt;
(require '[clojure.tools.cli :as cli])&lt;br&gt;
=&amp;gt; nil&lt;br&gt;
(def opts [[&quot;-d&quot; &quot;--debug&quot;]])&lt;br&gt;
=&amp;gt; #'net.lewisship.cli-tools-test/opts&lt;br&gt;
(cli/parse-opts&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[&quot;--foo&quot;]
[]
:in-order true)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;=&amp;gt; {:options {}, :arguments [], :summary &quot;&quot;, :errors [&quot;Unknown option: \&quot;--foo\&quot;&quot;]}&lt;br&gt;
(cli/parse-opts&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[&quot;xxx&quot; &quot;--foo&quot;]
[]
:in-order true)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;=&amp;gt; {:options {}, :arguments [&quot;xxx&quot; &quot;--foo&quot;], :summary &quot;&quot;, :errors nil}&lt;br&gt;
&lt;code&gt;`&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;However, it will assume an undefined option is an error until the first non-option argument is consumed.&lt;/p&gt;
&lt;p&gt;I would like a further option that is like :in-order but accepting of these unrecognized options.  Maybe, :passthru-options would be a good name?&lt;/p&gt;
&lt;p&gt;I can work on a patch if we have some consensus on direction.&lt;/p&gt;
</description>
<category>tools.cli</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14977/tools-cli-capture-unrecognized-options-unparsed-arguments</guid>
<pubDate>Fri, 06 Mar 2026 00:35:16 +0000</pubDate>
</item>
<item>
<title>clojure.core.cache caches delays that hold exceptions as of version 1.2.254</title>
<link>https://ask.clojure.org/index.php/14965/clojure-core-cache-caches-delays-that-hold-exceptions-version</link>
<description>&lt;p&gt;As of version 1.2.254 of &lt;code&gt;org.clojure/core.cache&lt;/code&gt;, using a &lt;code&gt;value-fn&lt;/code&gt; that throws will cause an entry to be added to the cache associated with a Delay with &lt;code&gt;:status :failed&lt;/code&gt; and the exception as a value.&lt;/p&gt;
&lt;p&gt;The code below can be used to compare the behavior between versions 1.1.234 and 1.2.254.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(require '[clojure.core.cache.wrapped :as cw])

(def counter (atom 0))

(defn value-fn [v]
  (prn :value-fn-called)
  (swap! counter inc)
  (if (= @counter 1)
    (throw (ex-info &quot;thrown&quot; {}))
    v))

(def test-cache (cw/lu-cache-factory {} :threshold 10))

(reset! counter 0)
; this will throw
(cw/lookup-or-miss test-cache &quot;throw&quot; value-fn)
; in 1.1.234 this will call value-fn again and not throw; in 1.2.254, it won't call and return
; the cached delay result, which is an exception
(cw/lookup-or-miss test-cache &quot;throw&quot; value-fn)

; evict to force call to value-fn
(cw/evict test-cache &quot;throw&quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is related to work done in &lt;a rel=&quot;nofollow&quot; href=&quot;http://clojure.atlassian.net/browse/CCACHE-65&quot;&gt;CCACHE-65&lt;/a&gt; to avoid cache stampede in multi-threaded applications, and could be related to what has been reported in &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CMEMOIZE-31&quot;&gt;CMEMOIZE-31&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This was initially reported &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojurians.slack.com/archives/C03S1KBA2/p1771873303347759&quot;&gt;in Clojurians Slack&lt;/a&gt;.&lt;/p&gt;
</description>
<category>core.cache</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14965/clojure-core-cache-caches-delays-that-hold-exceptions-version</guid>
<pubDate>Mon, 23 Feb 2026 19:43:34 +0000</pubDate>
</item>
<item>
<title>javadoc-data-fn does not find selected method for inherited methods</title>
<link>https://ask.clojure.org/index.php/14921/javadoc-data-does-not-find-selected-method-inherited-methods</link>
<description>&lt;p&gt;Even though java.util.jar.JarEntry/.getName is a valid qualified method, the selected method docs aren't found.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;gt; java.util.jar.JarEntry/.getName
 #function[...]

&amp;gt; (clojure.java.doc.api/javadoc-data-fn
   &quot;java.util.jar.JarEntry/.getName&quot;
   nil)
{:classname &quot;java.util.jar.JarEntry&quot;,
 :class-description-html &quot;&amp;lt;section ...&quot;,
 :class-description-md &quot;All Implemented...&quot;,
 :methods
 [{:signature &quot;getAttributes()&quot;,
   :description
   &quot;Returns the Manifest Attributes for this entry, or null if none.&quot;,
   :static? false,
   :return-type &quot;Attributes&quot;,
   :clojure-call &quot;java.util.jar.JarEntry/.getAttributes&quot;}
  ...],
 :selected-method []}
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>java.doc</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14921/javadoc-data-does-not-find-selected-method-inherited-methods</guid>
<pubDate>Sat, 07 Feb 2026 19:55:52 +0000</pubDate>
</item>
<item>
<title>clojure.java.doc.api/javadoc-data-fn does not include constructor info</title>
<link>https://ask.clojure.org/index.php/14920/clojure-java-doc-javadoc-data-does-include-constructor-info</link>
<description>&lt;p&gt;It would be helpful to include the constructor summary info from the javadoc. I tried querying the class as well as the /new method value.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(clojure.java.doc.api/javadoc-data-fn 
 &quot;java.io.PushbackReader/new&quot; nil)
(clojure.java.doc.api/javadoc-data-fn 
 &quot;java.io.PushbackReader&quot; nil)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I've integrated java.doc into my IDE and it's been very helpful. Thanks!&lt;/p&gt;
</description>
<category>java.doc</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14920/clojure-java-doc-javadoc-data-does-include-constructor-info</guid>
<pubDate>Fri, 06 Feb 2026 05:58:34 +0000</pubDate>
</item>
<item>
<title>`flow/ping-proc` can be slow or fail to respond, even when process isn't busy</title>
<link>https://ask.clojure.org/index.php/14911/flow-ping-proc-slow-fail-respond-even-when-process-isnt-busy</link>
<description>&lt;p&gt;I've run into a few cases where &lt;code&gt;flow/ping&lt;/code&gt; and &lt;code&gt;flow/ping-proc&lt;/code&gt; are slow and timeout.&lt;/p&gt;
&lt;p&gt;I was able to track the issue down to this line &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/core.async/blob/b871f3519de6843a9f5ce66cf8d5c6cbe44d3222/src/main/clojure/clojure/core/async/flow/impl.clj#L273&quot;&gt;https://github.com/clojure/core.async/blob/b871f3519de6843a9f5ce66cf8d5c6cbe44d3222/src/main/clojure/clojure/core/async/flow/impl.clj#L273&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(async/&amp;gt;!! c
            (walk/postwalk datafy
                           #::flow{:pid pid, :status status
                                   :state state,
                                   :count count
                                   :ins pins :outs pouts}))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This causes the state of the flow process to be traversed and datafied.&lt;/p&gt;
&lt;p&gt;In one case, I had some process state that threw an exception when datafied due to an incomplete datafy extension. This caused &lt;code&gt;flow/ping-proc&lt;/code&gt; to silently fail. No errors were reported.&lt;/p&gt;
&lt;p&gt;In some other cases, the flow processes were working with large values. Walking the process state was slow and caused pings to respond slowly.&lt;/p&gt;
</description>
<category>core.async</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14911/flow-ping-proc-slow-fail-respond-even-when-process-isnt-busy</guid>
<pubDate>Wed, 28 Jan 2026 18:01:40 +0000</pubDate>
</item>
<item>
<title>Core Cache and Count</title>
<link>https://ask.clojure.org/index.php/14910/core-cache-and-count</link>
<description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I notice that in the wrapped namespace of core.cache, there is a &lt;strong&gt;has?&lt;/strong&gt; function that checks the wrapped cache if it has an element or not. It does this by delegating to the underlying cache &lt;strong&gt;c/has?&lt;/strong&gt; function of the wrapped cache.&lt;/p&gt;
&lt;p&gt;For reporting purposes, I need to get the current size of the cache (with the caveat of course that the size could be approximate, given the particular nature of a particular cache - but approximation is fine).&lt;/p&gt;
&lt;p&gt;Unfortuantely, a &lt;strong&gt;size&lt;/strong&gt; or &lt;strong&gt;count&lt;/strong&gt; function doesn't exist in the wrapped namespace, it only exists on the wrapped cache itself - thus doing:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(count @wrapped-cache)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; does return the value. &lt;/p&gt;
&lt;p&gt;It would be good, however,  if there was also a similar function in the wrapped namespace, something like this (using &lt;strong&gt;size&lt;/strong&gt; as the function name, but could be something else):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defn size
   [cache-atom]
   (c/count @cache-atom)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The rationale being that having this function exposed in the wrapped namespace keeps the code consistent - i.e., whilst I can continue to do:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(count @wrapped-cache)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It would more preferrable to keep using the wrapped namespace (as I do with other operations, such as evict), i.e., something along the lines of:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(wrapped/size wrapped-cache)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Do you think this suggestion might be something that could be included in the wrapped namespace?&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;-=david=-&lt;/p&gt;
</description>
<category>core.cache</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14910/core-cache-and-count</guid>
<pubDate>Wed, 28 Jan 2026 16:54:22 +0000</pubDate>
</item>
<item>
<title>clojure.java.doc.api/javadoc-data-fn does not include return types for methods</title>
<link>https://ask.clojure.org/index.php/14898/clojure-java-javadoc-data-does-include-return-types-methods</link>
<description>&lt;p&gt;Calling &lt;code&gt;clojure.java.doc.api/javadoc-data-fn&lt;/code&gt; returns data about methods of a java class in the &lt;code&gt;:methods&lt;/code&gt; and &lt;code&gt;:selected-method&lt;/code&gt; entries. It does not include any directly accessible description of the return types for methods. The return type for a method can be found indirectly in the &lt;code&gt;:method-description-html&lt;/code&gt; and &lt;code&gt;:method-description-md&lt;/code&gt; entries of the &lt;code&gt;:selected-method&lt;/code&gt;s (but not the &lt;code&gt;:methods&lt;/code&gt; entries).&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(def jdoc-data
  (clojure.java.doc.api/javadoc-data-fn &quot;CharSequence/.charAt&quot;
                                        nil))
  
(def my-method (-&amp;gt; jdoc-data :selected-method first))

&amp;gt; my-method
{:signature &quot;charAt(int index)&quot;,
 :description &quot;Returns the char value at the specified index.&quot;,
 :static? false,
 :clojure-call &quot;^[int] CharSequence/.charAt&quot;,
 :method-description-html &quot;&amp;lt;section class ...&quot;,
 :method-description-md &quot;### charAt {#charAt(int)}\n\nchar charAt (int index)...&quot;}
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>java.doc</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14898/clojure-java-javadoc-data-does-include-return-types-methods</guid>
<pubDate>Tue, 20 Jan 2026 22:26:31 +0000</pubDate>
</item>
<item>
<title>How to access non-jar artifacts (aar, zip) downloaded via tools.deps in build.clj?</title>
<link>https://ask.clojure.org/index.php/14862/how-access-non-jar-artifacts-aar-downloaded-tools-deps-build</link>
<description>&lt;p&gt;I want to access an aar/zip artifact in build.clj that's already downloaded via deps.edn:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{:deps
 {com.newrelic.agent.android/android-agent {:local/root &quot;build/jars/android-agent.jar&quot;
                                            :doc        &quot;extracted from aar&quot;}
  com.newrelic.agent.java/newrelic-api     {:local/root &quot;build/jars/newrelic-api.jar&quot;
                                            :doc        &quot;extracted from newrelic-java.zip&quot;}}
 :aliases
 {:build {:deps       {io.github.clojure/tools.build            {:mvn/version &quot;0.10.11&quot;}
                       com.newrelic.agent.java/newrelic-java    {:mvn/version &quot;8.25.1&quot;
                                                                 :extension   &quot;zip&quot;}
                       com.newrelic.agent.android/android-agent {:mvn/version &quot;7.6.14&quot;
                                                                 :extension   &quot;aar&quot;}}
          :ns-default build}}}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In build.clj I need to unpack this zip and extract a jar from it.&lt;br&gt;
And I don't have to hardcode .m2 paths or duplicate the version.&lt;/p&gt;
&lt;p&gt;How can it be done?&lt;/p&gt;
&lt;p&gt;See &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/tools.deps/blob/46661e929ab702d0ee532188edb58d06b39cef6c/src/main/clojure/clojure/tools/deps/extensions/maven.clj#L172&quot;&gt;https://github.com/clojure/tools.deps/blob/46661e929ab702d0ee532188edb58d06b39cef6c/src/main/clojure/clojure/tools/deps/extensions/maven.clj#L172&lt;/a&gt;&lt;/p&gt;
</description>
<category>tools.deps</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14862/how-access-non-jar-artifacts-aar-downloaded-tools-deps-build</guid>
<pubDate>Wed, 24 Dec 2025 08:55:46 +0000</pubDate>
</item>
<item>
<title>flow monitoring tool serves resources from unqualified path</title>
<link>https://ask.clojure.org/index.php/14748/flow-monitoring-tool-serves-resources-from-unqualified-path</link>
<description>&lt;p&gt;For flow monitoring, HTML, CSS, and javascript assets are served from the resource path &quot;public/&quot;. If there is another library on the classpath that also has a resource at &quot;public/index.html&quot;, then flow monitoring's assets will get clobbered and serve the wrong web page instead. Alternatively, flow monitoring may clobber someone else's resources.&lt;/p&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/core.async.flow-monitor/blob/6248a5d8e4228ab5974289559e3cb11ff3152263/src/clojure/core/async/flow_monitor.clj#L104&quot;&gt;https://github.com/clojure/core.async.flow-monitor/blob/6248a5d8e4228ab5974289559e3cb11ff3152263/src/clojure/core/async/flow_monitor.clj#L104&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This can be addressed by moving resources to a qualified path like &quot;clojure/core/async/flow_monitor/public/index.html&quot;.&lt;/p&gt;
</description>
<category>core.async</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14748/flow-monitoring-tool-serves-resources-from-unqualified-path</guid>
<pubDate>Tue, 04 Nov 2025 20:57:47 +0000</pubDate>
</item>
<item>
<title>`pipeline-blocking` uses `thread` internally instead of `io-thread`</title>
<link>https://ask.clojure.org/index.php/14738/pipeline-blocking-uses-thread-internally-instead-of-thread</link>
<description>&lt;p&gt;&lt;code&gt;pipeline-blocking&lt;/code&gt; is explicitly meant for blocking operations (implying I/O). However, internally it uses &lt;code&gt;thread&lt;/code&gt; rather than &lt;code&gt;io-thread&lt;/code&gt; for processing: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async.clj#L637-L640&quot;&gt;https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async.clj#L637-L640&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Since 1.9.829-alpha2 this has practical implications, as only &lt;code&gt;io-thread&lt;/code&gt; will utilize virtual threads, when available.&lt;/p&gt;
&lt;p&gt;Can this be fixed / changed?&lt;br&gt;
If not, can an explicit &lt;code&gt;pipeline-io&lt;/code&gt; (or similar)  function be added to support this use case?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
</description>
<category>core.async</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14738/pipeline-blocking-uses-thread-internally-instead-of-thread</guid>
<pubDate>Wed, 29 Oct 2025 15:54:00 +0000</pubDate>
</item>
<item>
<title>Can doc and jdoc be refactored to a common protocol while it's still early?</title>
<link>https://ask.clojure.org/index.php/14734/can-doc-and-jdoc-refactored-common-protocol-while-still-early</link>
<description>&lt;p&gt;A fresh clojure library clojure.java.doc introduces some nice functions for querying javadoc.&lt;br&gt;
It all seems nice and useful, I really can't complain (nor this is high priority to me since Javadoc is usually so verbose that I would probably continue to read it in the Web browser unless I discover use cases where REPL access is more practical to me).&lt;/p&gt;
&lt;p&gt;However, one thing that struck my mind, and I had to ask is this: why introduce new functions, such as jdoc? Wouldn't it be more convenient to introduce a protocol (say, doc) which could then be extended to support&lt;br&gt;
1. original Clojure doc&lt;br&gt;
2. Javadoc&lt;br&gt;
3. some sort of javascript doc, if that exists&lt;br&gt;
4. C# doc&lt;br&gt;
5. Native libraries doc, etc.&lt;/p&gt;
&lt;p&gt;I understand that doc is a part of Clojure core, which you avoid changing at any costs, but this protocol wouldn't have to touch it.&lt;/p&gt;
&lt;p&gt;It could simply be a &quot;replacement&quot; from the new namespace, which would have one implementation that invokes doc, but also be open to other implementations, such as jdoc.&lt;/p&gt;
&lt;p&gt;And I understand that for Clojure core it's an absolute priority to not even change a formatting of the source code unless it's absolutely necessary, to keep very detailed compilation behavior or whatnot. It's a choice you made, it has its traidoffs, you chose those, and that's it. But, are those tradeoffs the same for namespaces such as clojure.repl and functions such as doc?&lt;/p&gt;
</description>
<category>java.doc</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14734/can-doc-and-jdoc-refactored-common-protocol-while-still-early</guid>
<pubDate>Tue, 28 Oct 2025 11:41:48 +0000</pubDate>
</item>
<item>
<title>Choosing between core.async pipelines</title>
<link>https://ask.clojure.org/index.php/14732/choosing-between-core-async-pipelines</link>
<description>&lt;p&gt;It's no longer clear what kind of pipeline is suitable for what kind of task in &lt;code&gt;core.async&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Previously, my understanding was that anything I/O-bound should go into &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/core.async/blob/v1.9.829-alpha2/src/main/clojure/clojure/core/async.clj#L682-L686&quot;&gt;&lt;code&gt;pipeline-blocking&lt;/code&gt;&lt;/a&gt;, while CPU-bound tasks went into regular (i.e. &lt;code&gt;:compute&lt;/code&gt;) &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/core.async/blob/v1.9.829-alpha2/src/main/clojure/clojure/core/async.clj#L665-L680&quot;&gt;&lt;code&gt;pipeline&lt;/code&gt;&lt;/a&gt;. But a while back &lt;code&gt;:compute&lt;/code&gt; pipelines were &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/core.async/commit/3429e3e1f1d49403bf9608b36dbd6715ffe4dd4f&quot;&gt;changed&lt;/a&gt; to use threads instead of go-blocks. And now, with the introduction of &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.org/news/2025/10/01/async_virtual_threads&quot;&gt;virtual threads&lt;/a&gt;, &lt;code&gt;pipeline-async&lt;/code&gt; seems like the right choice for I/O-bound tasks.&lt;/p&gt;
&lt;p&gt;It seems that workloads are being classified into one of &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/core.async/blob/v1.9.829-alpha2/src/main/clojure/clojure/core/async/impl/dispatch.clj#L130-L132&quot;&gt;three types&lt;/a&gt;: &lt;code&gt;:compute&lt;/code&gt;, &lt;code&gt;:io&lt;/code&gt;, and &lt;code&gt;:mixed&lt;/code&gt;. Is &lt;code&gt;:async&lt;/code&gt; meant to be the equivalent of &lt;code&gt;:io&lt;/code&gt;, and &lt;code&gt;:blocking&lt;/code&gt; the equivalent of &lt;code&gt;:mixed&lt;/code&gt;? I don't think that's original semantics, but it seems to be the mapping now.&lt;/p&gt;
</description>
<category>core.async</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14732/choosing-between-core-async-pipelines</guid>
<pubDate>Sun, 26 Oct 2025 22:19:12 +0000</pubDate>
</item>
<item>
<title>An undocumented breaking change in data.json</title>
<link>https://ask.clojure.org/index.php/14728/an-undocumented-breaking-change-in-data-json</link>
<description>&lt;p&gt;between the versions &lt;code&gt;1.1.0&lt;/code&gt; and &lt;code&gt;2.0.0&lt;/code&gt;, data.json introduced a breaking change: The &lt;code&gt;JSONWriter#-write&lt;/code&gt; signature changed from &lt;code&gt;[object out]&lt;/code&gt; to &lt;code&gt;[object out options]&lt;/code&gt;&lt;br&gt;
On this commit:&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/data.json/commit/8f070ba94dc7c469f303259ce5f5bfa0b53d50bd&quot;&gt;https://github.com/clojure/data.json/commit/8f070ba94dc7c469f303259ce5f5bfa0b53d50bd&lt;/a&gt;&lt;br&gt;
In release notes &lt;code&gt;Release 2.0.0 on 2021-Mar-19 &lt;/code&gt;, there is no mention to &lt;code&gt;JSONWriter&lt;/code&gt; or &lt;code&gt;-write&lt;/code&gt; protocol changes.&lt;/p&gt;
&lt;p&gt;I know it's a very old problem, but I think this documentation could be present.&lt;/p&gt;
</description>
<category>data.json</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14728/an-undocumented-breaking-change-in-data-json</guid>
<pubDate>Thu, 23 Oct 2025 17:18:23 +0000</pubDate>
</item>
<item>
<title>Allocation churn on generators</title>
<link>https://ask.clojure.org/index.php/14721/allocation-churn-on-generators</link>
<description>&lt;p&gt;When generating moderately large values there is some LazySeq churn that could be avoided. For example, the following snippet allocates over 15GB (measured with async-profiler):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(core/let [g (vector (not-empty string-alphanumeric) 1000 5000)]
  (time
   (dotimes [seed 50]
     (dorun (generate g 100 seed)))))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The pattern of generating multiple (increasingly larger) values is common with quick-check (via deftest et al).&lt;/p&gt;
&lt;p&gt;Many generators are built on top of &lt;code&gt;choose&lt;/code&gt;, and there is an opportunity to reduce churn by special casing &lt;code&gt;shrink-int&lt;/code&gt; for longs (which should be the common case compared to big ints).&lt;/p&gt;
&lt;p&gt;I have a patch that decreases total allocations of the repro above by ~15% and speed up the run time by ~25% (measured on jdk 25, with &lt;code&gt;-Xmx512m -XX:+UseSerialGC&lt;/code&gt; to decrease variance). Happy to share it.&lt;/p&gt;
</description>
<category>test.check</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14721/allocation-churn-on-generators</guid>
<pubDate>Tue, 07 Oct 2025 21:16:10 +0000</pubDate>
</item>
<item>
<title>Replace core.async’s internal LinkedList queue with ArrayDeque?</title>
<link>https://ask.clojure.org/index.php/14696/replace-core-asyncs-internal-linkedlist-queue-arraydeque</link>
<description>&lt;p&gt;Hi! While reading the channel implementation I noticed the internal queue is a &lt;code&gt;java.util.LinkedList&lt;/code&gt;:&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async/impl/channels.clj&quot;&gt;https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async/impl/channels.clj&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The common JVM guidance these days is to prefer &lt;code&gt;java.util.ArrayDeque&lt;/code&gt; for FIFO/LIFO queues due to better locality and lower GC overhead. For example, the JDK docs state: “This class is likely to be faster than Stack when used as a stack, and faster than LinkedList when used as a queue.”&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.oracle.com/javase/8/docs/api/java/util/ArrayDeque.html&quot;&gt;https://docs.oracle.com/javase/8/docs/api/java/util/ArrayDeque.html&lt;/a&gt;&lt;br&gt;
Related SO discussion: &lt;a rel=&quot;nofollow&quot; href=&quot;https://stackoverflow.com/questions/6163166/why-is-arraydeque-better-than-linkedlist&quot;&gt;https://stackoverflow.com/questions/6163166/why-is-arraydeque-better-than-linkedlist&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;A few questions for the maintainers:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Was &lt;code&gt;LinkedList&lt;/code&gt; originally chosen for a specific reason (e.g., very old JDK compatibility)?&lt;/li&gt;
&lt;li&gt;Are there behaviors in channels that specifically rely on &lt;code&gt;LinkedList&lt;/code&gt; (e.g., allowing null, I believe channels disallow nil anyway, or particular iterator characteristics), or would &lt;code&gt;ArrayDeque&lt;/code&gt; be a drop-in replacement for the add/remove-from-ends operations used?&lt;/li&gt;
&lt;li&gt;If we provide a small PR and benchmark showing an improvement (lower allocations / better throughput under contention), would such a change be considered?&lt;/li&gt;
&lt;li&gt;Since &lt;code&gt;ArrayDeque&lt;/code&gt; is available on Java 8+, and current Clojure/core.async baselines target that or newer, is there any remaining compatibility concern?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Context: there was an older conversation in Clojurians (#clojure) that suggested ArrayDeque could reduce GC pressure under load and that the original choice may have been influenced by older JDKs:&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://clojurians.slack.com/archives/C03S1KBA2/p1526551888000376&quot;&gt;https://clojurians.slack.com/archives/C03S1KBA2/p1526551888000376&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If this sounds reasonable, I’m happy to run the core.async test suite, add JMH-style benchmarks focused on channel put/take hot paths, and submit a PR.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
</description>
<category>core.async</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14696/replace-core-asyncs-internal-linkedlist-queue-arraydeque</guid>
<pubDate>Tue, 02 Sep 2025 08:02:18 +0000</pubDate>
</item>
<item>
<title>Typos in Flow guide</title>
<link>https://ask.clojure.org/index.php/14686/typos-in-flow-guide</link>
<description>&lt;p&gt;As reported by a &lt;a rel=&quot;nofollow&quot; href=&quot;https://news.ycombinator.com/item?id=44936309&quot;&gt;Hacker News user&lt;/a&gt;, there are typos in the &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.github.io/core.async/flow-guide.html&quot;&gt;Flow Guide&lt;/a&gt;  :&lt;/p&gt;
&lt;p&gt;&quot;excepiton&quot; should be &quot;exception&quot;&lt;br&gt;
&quot;provded&quot; should be &quot;provided&quot;&lt;/p&gt;
&lt;p&gt;and also, it seems that in the transition section, &quot;The description arity takes the current state ...&quot; should be &quot;The transition arity takes the current state ...&quot;&lt;/p&gt;
</description>
<category>core.async</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14686/typos-in-flow-guide</guid>
<pubDate>Mon, 18 Aug 2025 08:19:35 +0000</pubDate>
</item>
<item>
<title>tools.build compile-clj capture out/err</title>
<link>https://ask.clojure.org/index.php/14648/tools-build-compile-clj-capture-out-err</link>
<description>&lt;p&gt;When calling &lt;code&gt;compile-clj&lt;/code&gt;, a user can pass in &lt;code&gt;:out&lt;/code&gt; and &lt;code&gt;:err&lt;/code&gt; to capture the output of the compilation call. However, if for some reason the sub-process exits with a non-0, &lt;code&gt;compile-clj&lt;/code&gt; throws without returning that output, making it hard to know what went wrong. (see here: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/tools.build/blob/2d2f1b05fd84c3cc756221c17fcfb98034b4d65c/src/main/clojure/clojure/tools/build/tasks/compile_clj.clj#L120&quot;&gt;https://github.com/clojure/tools.build/blob/2d2f1b05fd84c3cc756221c17fcfb98034b4d65c/src/main/clojure/clojure/tools/build/tasks/compile_clj.clj#L120&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;I would find it helpful if the ex-data of the thrown exception included the &lt;code&gt;:out&lt;/code&gt; (variable &lt;code&gt;ps-out&lt;/code&gt; and &lt;code&gt;:err&lt;/code&gt; (variable &lt;code&gt;ps-err&lt;/code&gt;) from the &lt;code&gt;process/process&lt;/code&gt; call. Then I could have further insight into what went wrong.&lt;/p&gt;
</description>
<category>tools.build</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14648/tools-build-compile-clj-capture-out-err</guid>
<pubDate>Mon, 28 Jul 2025 19:41:29 +0000</pubDate>
</item>
<item>
<title>Is core.async.flow available in ClojureScript?</title>
<link>https://ask.clojure.org/index.php/14633/is-core-async-flow-available-in-clojurescript</link>
<description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I know it's early days for core.async.flow but I thought I would give it a try in one of my ClojureScript projects.&lt;/p&gt;
&lt;p&gt;I've got &lt;code&gt;{:mvn/version &quot;1.9.808-alpha1&quot;}&lt;/code&gt; in my deps.edn but I'm getting the following error when I try to access the namespace:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;No such namespace: clojure.core.async.flow, could not locate clojure/core/async/flow.cljs&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Thanks for your help.&lt;/p&gt;
</description>
<category>core.async</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14633/is-core-async-flow-available-in-clojurescript</guid>
<pubDate>Thu, 17 Jul 2025 08:31:10 +0000</pubDate>
</item>
<item>
<title>tools.build fails with http_proxy/https_proxy set</title>
<link>https://ask.clojure.org/index.php/14602/tools-build-fails-with-httpproxy-httpsproxy-set</link>
<description>&lt;p&gt;The autopkgtest of the tools.build package fails with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Running tests in #{&quot;src/test/clojure&quot;}

Testing clojure.tools.build.tasks.test-basis
Warning: failed to load the S3TransporterFactory class
Jul 01, 2025 8:15:38 AM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.net.SocketException) caught when processing request to {s}-&amp;gt;https://repo1.maven.org:443: Network is unreachable
[...]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The autopkgtest script debian/tests/source:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#!/bin/bash

set -ueo pipefail

cp=($(&amp;lt; debian/libtools-build-clojure.classpath))
test &quot;${cp[0]}&quot; = usr/share/java/tools.build.jar
unset cp[0] # drop it

test_cp=(src/main/clojure
         src/test/clojure
         /usr/share/java/test-runner.jar
         /usr/share/java/maven-resolver-named-locks.jar
         /usr/share/java/maven-repository-metadata-3.x.jar
         &quot;${cp[@]}&quot;)

test_cp=&quot;$(IFS=:; echo &quot;${test_cp[*]}&quot;)&quot;

# Derived from ./deps.edn, and avoids a circular dep on clojure-cli
java -XX:-OmitStackTraceInFastThrow -cp &quot;$test_cp&quot; clojure.main \
     -m cognitect.test-runner cognitect.test-runner.api/test \
     --dir src/test/clojure --namespace-regex '.*'
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The Ubuntu autopkgtest infrastructure restrict the Internet access and sets http_proxy/https_proxy.&lt;/p&gt;
&lt;p&gt;Please support those proxy settings.&lt;/p&gt;
&lt;p&gt;Bug-Ubuntu: &lt;a rel=&quot;nofollow&quot; href=&quot;https://launchpad.net/bugs/2115740&quot;&gt;https://launchpad.net/bugs/2115740&lt;/a&gt;&lt;/p&gt;
</description>
<category>tools.build</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14602/tools-build-fails-with-httpproxy-httpsproxy-set</guid>
<pubDate>Wed, 02 Jul 2025 11:56:53 +0000</pubDate>
</item>
<item>
<title>`create-basis` silently accepts missing aliases</title>
<link>https://ask.clojure.org/index.php/14584/create-basis-silently-accepts-missing-aliases</link>
<description>&lt;p&gt;In &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojars/clojars-web/commit/baade8967c7be8abd9a9b27499c511efd41f6164&quot;&gt;this scenario&lt;/a&gt;, the alias for &lt;code&gt;create-basis&lt;/code&gt; was incorrect, preventing security deps overrides from being applied. For 2 years clojars was deployed with these vulnerable deps.&lt;/p&gt;
&lt;p&gt;In this case, I proposed &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojars/clojars-web/pull/906&quot;&gt;to inline the alias&lt;/a&gt; into &lt;code&gt;:deps&lt;/code&gt;. However there may be other scenarios where a tools.deps change might be helpful to catch these mistakes earlier, for example a warning or error.&lt;/p&gt;
</description>
<category>tools.deps</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14584/create-basis-silently-accepts-missing-aliases</guid>
<pubDate>Tue, 10 Jun 2025 00:57:37 +0000</pubDate>
</item>
<item>
<title>Dependency between options in Clojure/tools.cli ?</title>
<link>https://ask.clojure.org/index.php/14556/dependency-between-options-in-clojure-tools-cli</link>
<description>&lt;p&gt;Hello, newbie user of tools.cli here.&lt;/p&gt;
&lt;p&gt;I'm having a use case where I'd like to describe dependencies between options.&lt;br&gt;
For example : if option -a is used, then options -f and -d are required too.&lt;/p&gt;
&lt;p&gt;Looking at the documentation, it seems that the function option :in-order may allow that, but I haven't been able to figure how to use it. And haven't found any tutorial on that topic.&lt;/p&gt;
&lt;p&gt;Anyone who could provide some pointers and/or example on how to express such dependencies (if that's possible).&lt;/p&gt;
&lt;p&gt;Thank you! &lt;/p&gt;
</description>
<category>tools.cli</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14556/dependency-between-options-in-clojure-tools-cli</guid>
<pubDate>Tue, 27 May 2025 11:24:35 +0000</pubDate>
</item>
<item>
<title>what kind of systems could be made with clojure.async.flow?</title>
<link>https://ask.clojure.org/index.php/14526/what-kind-of-systems-could-be-made-with-clojure-async-flow</link>
<description>&lt;p&gt;Trying to capture mechanical essence of &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.github.io/core.async/flow.html&quot;&gt;clojure.async.flow&lt;/a&gt; with basic terms instead of flow own terms i guess that clojure.async.flow allows to structure a system as a set of stateful functions running concurrently in the same jvm process and interacting with each other explicitly via channels.&lt;/p&gt;
&lt;p&gt;what kind of systems could be made with clojure.async.flow?&lt;/p&gt;
&lt;p&gt;it's definitely not naive service which handles API http requests, transforms it somehow and puts it into database.&lt;/p&gt;
</description>
<category>core.async</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14526/what-kind-of-systems-could-be-made-with-clojure-async-flow</guid>
<pubDate>Tue, 29 Apr 2025 15:48:35 +0000</pubDate>
</item>
<item>
<title>tools.cli: Support default value for arg with value</title>
<link>https://ask.clojure.org/index.php/14524/tools-cli-support-default-value-for-arg-with-value</link>
<description>&lt;p&gt;I would like to have a &lt;code&gt;--diff&lt;/code&gt; flag which defaults to &lt;code&gt;origin/HEAD&lt;/code&gt; but allow pass a different rev in the arg, like &lt;code&gt;--diff origin/bar&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Context: &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojurians.slack.com/archives/C03S1KBA2/p1745859358672599&quot;&gt;https://clojurians.slack.com/archives/C03S1KBA2/p1745859358672599&lt;/a&gt;&lt;/p&gt;
</description>
<category>tools.cli</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14524/tools-cli-support-default-value-for-arg-with-value</guid>
<pubDate>Mon, 28 Apr 2025 17:21:53 +0000</pubDate>
</item>
<item>
<title>clojure.tools.reader.edn/read can cause incorrect column number for token at end of input</title>
<link>https://ask.clojure.org/index.php/14437/clojure-tools-reader-cause-incorrect-column-number-token-input</link>
<description>&lt;p&gt;&lt;strong&gt;Context&lt;/strong&gt;&lt;br&gt;
A user reported that &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clj-commons/rewrite-clj/issues/367&quot;&gt;rewrite-clj column number metadata can be incorrect for a token at the end of input&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;Rewrite-clj uses clojure.tools/reader to read clojure source.&lt;br&gt;
It uses &lt;code&gt;clojure.tools.reader.reader-types/get-column-number&lt;/code&gt; to discover the current column offset.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Affected&lt;/strong&gt;&lt;br&gt;
clojure.tools/reader v1.3.4 through v1.5.0&lt;br&gt;
Clojure only (not ClojureScript)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Env&lt;/strong&gt;&lt;br&gt;
On Linux using Clojure CLI 1.12.0.1517 with JDK 23.0.2 (temurin)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Symptom&lt;/strong&gt;&lt;br&gt;
When the element at end of input is a token, after it is read, the column number is one less than it should be.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Setup&lt;/strong&gt;&lt;br&gt;
Let's setup a playground in &lt;code&gt;foo.clj&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(ns foo
  (:require [clojure.pprint :refer [pprint]]
            [clojure.tools.reader.edn :as edn]
            [clojure.tools.reader.reader-types :as rt]))

(defn reader [s]
  (-&amp;gt; s
      rt/string-push-back-reader
      rt/indexing-push-back-reader))

(defn dump-with-cols [s]
  (println &quot;input string:&quot; s)
  (println &quot;colnums:     &quot; (apply str (take (inc (count s)) (cycle [1 2 3 4 5 6 7 8 9 0])))))

(defn read-by-obj [s]
  (with-open [r (reader s)]
    (loop [acc [{:at :bof :col-number (rt/get-column-number r)}]
           obj (edn/read r false ::eof {})]
      (if (not= ::eof obj)
        (recur (conj acc {:after obj :col-number (rt/get-column-number r)})
               (edn/read r false ::eof {}))
        (conj acc {:at :eof :col-number (rt/get-column-number r)})))))

(let [s (first *command-line-args*)]
  (dump-with-cols s)
  (println &quot;parse result:&quot;)
  (pprint (read-by-obj s)))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Reproduction&lt;/strong&gt;&lt;br&gt;
Using clojure.tools/reader v1.5.0:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ clojure -Sdeps '{:deps {org.clojure/tools.reader {:mvn/version &quot;1.5.0&quot;}}}' \
        -M foo.clj ':bip :bop'
input string: :bip :bop
colnums:      1234567890
parse result:
[{:at :bof, :col-number 1}
 {:after :bip, :col-number 5}
 {:after :bop, :col-number 9}
 {:at :eof, :col-number 9}]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Notice after &lt;code&gt;:bip&lt;/code&gt; we see the correct &lt;code&gt;:col-number 5&lt;/code&gt;, but after &lt;code&gt;:bop&lt;/code&gt; we see the incorrect &lt;code&gt;:col-number 9&lt;/code&gt;; it should be &lt;code&gt;:col-number 10&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;An incorrect column number occurs for any unwrapped last token, a number:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ clojure -Sdeps '{:deps {org.clojure/tools.reader {:mvn/version &quot;1.5.0&quot;}}}' \
        -M foo.clj 123
input string: 123
colnums:      1234
parse result:
[{:at :bof, :col-number 1}
 {:after 123, :col-number 3}
 {:at :eof, :col-number 3}]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;a symbol:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ clojure -Sdeps '{:deps {org.clojure/tools.reader {:mvn/version &quot;1.5.0&quot;}}}' \
        -M foo.clj x
input string: x
colnums:      12
parse result:
[{:at :bof, :col-number 1}
 {:after x, :col-number 1}
 {:at :eof, :col-number 1}]

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But we get a correct result for syntax wrapped elements:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ clojure -Sdeps '{:deps {org.clojure/tools.reader {:mvn/version &quot;1.5.0&quot;}}}' \
        -M foo.clj '(x)'
input string: (x)
colnums:      1234
parse result:
[{:at :bof, :col-number 1}
 {:after (x), :col-number 4}
 {:at :eof, :col-number 4}]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Diagnosis&lt;/strong&gt;&lt;br&gt;
If I dial clojure.tools/reader back to v1.3.3, I don't see the issue:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ clojure -Sdeps '{:deps {org.clojure/tools.reader {:mvn/version &quot;1.3.3&quot;}}}' \
        -M foo.clj ':bip :bop'
input string: :bip :bop
colnums:      1234567890
parse result:
[{:at :bof, :col-number 1}
 {:after :bip, :col-number 5}
 {:after :bop, :col-number 10}
 {:at :eof, :col-number 10}]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And then bump one version to v1.3.4, I see the issue:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ clojure -Sdeps '{:deps {org.clojure/tools.reader {:mvn/version &quot;1.3.4&quot;}}}' \
        -M foo.clj ':bip :bop'
input string: :bip :bop
colnums:      1234567890
parse result:
[{:at :bof, :col-number 1}
 {:after :bip, :col-number 5}
 {:after :bop, :col-number 9}
 {:at :eof, :col-number 9}]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There was &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/tools.reader/commit/c8981dd6ac7a560db85321b03278d03caf2aed39&quot;&gt;only one significant change between v1.3.3 and v1.3.4&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Unreading the character at eof is causing the off-by-one issue.&lt;/p&gt;
&lt;p&gt;If I change the &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/tools.reader/blob/30d9f1d04417adc222ab57178dfd56d5d7a01d58/src/main/clojure/clojure/tools/reader/edn.clj#L54-L63&quot;&gt;existing&lt;/a&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  (loop [sb (StringBuilder.)
         ch initch]
    (if (or (whitespace? ch)
            (macro-terminating? ch)
            (nil? ch))
      (do (unread rdr ch)
          (str sb))
      (if (not-constituent? ch)
        (err/throw-bad-char rdr kind ch)
        (recur (doto sb (.append ch)) (read-char rdr))))))))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  (loop [sb (StringBuilder.)
         ch initch]
    (cond
      (or (whitespace? ch)
          (macro-terminating? ch))
      (do (unread rdr ch)
          (str sb))

      (nil? ch)
      (str sb)

      (not-constituent? ch)
      (err/throw-bad-char rdr kind ch)

      :else
      (recur (doto sb (.append ch)) (read-char rdr)))))))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The problem is resolved for me.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Next Steps&lt;/strong&gt;&lt;br&gt;
Happy to contribute a patch if the above makes sense to you and you think it is worthwhile to fix.&lt;/p&gt;
</description>
<category>tools.reader</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14437/clojure-tools-reader-cause-incorrect-column-number-token-input</guid>
<pubDate>Sat, 01 Mar 2025 16:58:43 +0000</pubDate>
</item>
<item>
<title>core.async go block error with clojure 1.12 method values</title>
<link>https://ask.clojure.org/index.php/14425/core-async-go-block-error-with-clojure-1-12-method-values</link>
<description>&lt;p&gt;I haven't seen this reported. &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(Long/.toString 123) ;;works
(a/&amp;lt;!! (a/thread (Long/.toString 123))) ;;works
(a/go (Long/.toString 123)) ;;error
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;Note: The following stack trace applies to the reader or compiler, your code was not executed.

CompilerException Syntax error macroexpanding a/go at (1:1). {:clojure.error/phase :macro-syntax-check, :clojure.error/line 1, :clojure.error/column 1, :clojure.error/source &quot;NO_SOURCE_PATH&quot;, :clojure.error/symbol a/go}
ExceptionInfo No matching method: .toString for class: class java.lang.Long and arity: 1 {:method .toString, :class java.lang.Long, :argc 1, :file &quot;NO_SOURCE_PATH&quot;, :column 7, :line 1}
	clojure.tools.analyzer.passes.jvm.validate/validate-call (validate.clj:127)
	clojure.tools.analyzer.passes.jvm.validate/validate-call (validate.clj:87)
	clojure.tools.analyzer.passes.jvm.validate/eval4802/fn--4803 (validate.clj:137)
	clojure.lang.MultiFn.invoke (MultiFn.java:229)
	clojure.tools.analyzer.passes.jvm.validate/validate (validate.clj:265)
	clojure.tools.analyzer.passes.jvm.validate/validate (validate.clj:240)
	clojure.lang.Var.invoke (Var.java:386)
	clojure.tools.analyzer.passes/compile-passes/fn--3424/fn--3429 (passes.clj:167)
	clojure.tools.analyzer.passes/compile-passes/fn--3424/fn--3431 (passes.clj:169)
	clojure.tools.analyzer.passes/compile-passes/fn--3424/fn--3431 (passes.clj:169)
	clojure.tools.analyzer.passes/compile-passes/fn--3424/fn--3431 (passes.clj:169)
	clojure.core/partial/fn--5929 (core.clj:2648)
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>core.async</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14425/core-async-go-block-error-with-clojure-1-12-method-values</guid>
<pubDate>Tue, 25 Feb 2025 19:17:23 +0000</pubDate>
</item>
<item>
<title>Please consider making tools.build pom.properties reproducible (e.g. the &quot;Generated by&quot; date)</title>
<link>https://ask.clojure.org/index.php/14389/please-consider-making-properties-reproducible-generated</link>
<description>&lt;p&gt;At the moment (in 1.2.24) the pom.properties includes the current date in a comment, making the resulting jars differ.  For now, in Debian we're deferring to SOURCE_DATE_EPOCH whenever it's set: &lt;a rel=&quot;nofollow&quot; href=&quot;https://salsa.debian.org/clojure-team/tools-build-clojure/-/blob/5739183ec76c39453ff267c6ba19c0605eb406b7/debian/patches/0002-write-pom-make-pom.properties-generated-date-reproducible.patch&quot;&gt;https://salsa.debian.org/clojure-team/tools-build-clojure/-/blob/5739183ec76c39453ff267c6ba19c0605eb406b7/debian/patches/0002-write-pom-make-pom.properties-generated-date-reproducible.patch&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;See also:&lt;br&gt;
- &lt;a rel=&quot;nofollow&quot; href=&quot;https://bugs.debian.org/1095578&quot;&gt;https://bugs.debian.org/1095578&lt;/a&gt; &lt;br&gt;
- &lt;a rel=&quot;nofollow&quot; href=&quot;https://reproducible-builds.org/docs/&quot;&gt;https://reproducible-builds.org/docs/&lt;/a&gt;&lt;br&gt;
- &lt;a rel=&quot;nofollow&quot; href=&quot;https://tests.reproducible-builds.org/debian/pomegranate-clojure&quot;&gt;https://tests.reproducible-builds.org/debian/pomegranate-clojure&lt;/a&gt;&lt;/p&gt;
</description>
<category>tools.build</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14389/please-consider-making-properties-reproducible-generated</guid>
<pubDate>Sun, 16 Feb 2025 18:43:21 +0000</pubDate>
</item>
<item>
<title>Auto-descending in clojure.data.zip doesn't seem to make a difference</title>
<link>https://ask.clojure.org/index.php/14380/auto-descending-clojure-data-zip-doesnt-seem-make-difference</link>
<description>&lt;p&gt;Learning about zippers, I am trying to make sense of the difference between &lt;code&gt;children&lt;/code&gt; and &lt;code&gt;children-auto&lt;/code&gt;, as documented in the &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.github.io/data.zip/&quot;&gt;auto-generated docs&lt;/a&gt;, however, by reviewing the code and inspecting its history with git-log, it looks like the last reading of this meta property (possibly through the &lt;code&gt;auto?&lt;/code&gt; function) was removed by &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/data.zip/commit/c5d6ca25c128f9fe937b11505c7c9736cfa2dd9a&quot;&gt;this commit in 2016&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I think I will give up my trying to understand what &quot;auto-descending by &lt;code&gt;tag=&lt;/code&gt;&quot; meant when it no longer matters. I would find it good to remove mentions of it from the documentation to save time to future learners like me, or at least clarify that the behaviour of &lt;code&gt;tag=&lt;/code&gt; doesn't change with the choice of &lt;code&gt;children&lt;/code&gt; v. &lt;code&gt;children-auto&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;What &lt;em&gt;could&lt;/em&gt; change, anyway, if there is no code sensitive to this metadatum in the library? Is there another library that uses it, or is it targeted only at user code (remembered in a comment to the &lt;code&gt;auto&lt;/code&gt; function), or is it just not useful anymore and should the metadatum (the &lt;code&gt;:zip-filter/no-auto?&lt;/code&gt; key) be dropped and associated functions (including &lt;code&gt;children-auto&lt;/code&gt;) with it?&lt;/p&gt;
</description>
<category>data.zip</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14380/auto-descending-clojure-data-zip-doesnt-seem-make-difference</guid>
<pubDate>Mon, 10 Feb 2025 11:05:44 +0000</pubDate>
</item>
<item>
<title>clojure.java.data/from-java throws stack overflow</title>
<link>https://ask.clojure.org/index.php/14379/clojure-java-data-from-java-throws-stack-overflow</link>
<description>&lt;p&gt;I use the following function to get scrollpoints from a  client io.qdrant.client.QdrantClient&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(def client ...) =&amp;gt; io.qdrant.client.QdrantClient

(defn make-scroll-points [collection-name k v]
  (builder/to-java Points$ScrollPoints
                   Points$ScrollPoints$Builder
                   (Points$ScrollPoints/newBuilder)
                   {:collectionName collection-name
                    :filter (builder/to-java Points$Filter
                                             Points$Filter$Builder
                                             (Points$Filter/newBuilder)
                                             {:addMust (ConditionFactory/matchKeyword (name k) (str v))}
                                             {})
                    :limit 1
                    :withPayload (WithPayloadSelectorFactory/enable true)}
                   {}))

(def scroll-points (qdrant/make-scroll-points  &amp;lt;collection-name&amp;gt; :user &quot;user-1&quot;))

(def scrolled (.get (.scrollAsync client scroll-points)))
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;(bean scrolled)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;works,  but when i do&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(clojure.java.data/from-java scrolled)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I get a stackoverflow error&lt;/p&gt;
</description>
<category>java.data</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14379/clojure-java-data-from-java-throws-stack-overflow</guid>
<pubDate>Mon, 10 Feb 2025 10:39:57 +0000</pubDate>
</item>
<item>
<title>clojure.java.data.builder fails with overloaded setter</title>
<link>https://ask.clojure.org/index.php/14349/clojure-java-data-builder-fails-with-overloaded-setter</link>
<description>&lt;p&gt;Trying to run make-chat-model&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(ns problem.problem
  (:require [clojure.java.data.builder :as builder])
  (:import (dev.langchain4j.model.openai OpenAiChatModel)
           (dev.langchain4j.model.openai OpenAiChatModel$OpenAiChatModelBuilder)))

(defn make-chat-model []
  (builder/to-java
    OpenAiChatModel 
    OpenAiChatModel$OpenAiChatModelBuilder
    (OpenAiChatModel/builder)
    {:baseUrl  &quot;localhost&quot;
     :apiKey (System/getenv &quot;OPENAI_API_KEY&quot;)} {}))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;fails with the following error &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:#error {}
 :cause Duplicate setter found for :modelName in dev.langchain4j.model.openai.OpenAiChatModel$OpenAiChatModelBuilder class
 :via
 [{:type java.lang.IllegalArgumentException
   :message Duplicate setter found for :modelName in dev.langchain4j.model.openai.OpenAiChatModel$OpenAiChatModelBuilder class
   :at [clojure.java.data.builder$find_setters$fn__9041 invoke builder.clj 66]}]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The code is in the following repo: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/gavlooth/problem&quot;&gt;https://github.com/gavlooth/problem&lt;/a&gt;&lt;/p&gt;
</description>
<category>java.data</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14349/clojure-java-data-builder-fails-with-overloaded-setter</guid>
<pubDate>Wed, 22 Jan 2025 20:27:39 +0000</pubDate>
</item>
<item>
<title>tools.namespace remove-node does not remove outgoing dependencies from :dependents</title>
<link>https://ask.clojure.org/index.php/14345/namespace-remove-remove-outgoing-dependencies-dependents</link>
<description>&lt;h3&gt;Problem&lt;/h3&gt;
&lt;p&gt;I noticed that when a dependency, &lt;code&gt;example.one&lt;/code&gt;, was removed from another namespace, &lt;code&gt;example.two&lt;/code&gt;, &lt;code&gt;example.one&lt;/code&gt; still showed up under &lt;code&gt;[::track/deps :dependents 'example.two]&lt;/code&gt; in the tracker after an invocation of &lt;code&gt;repl/scan&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;After digging into this for some time, I saw that the implementation of &lt;code&gt;remove-node&lt;/code&gt; in &lt;code&gt;MapDependencyGraph&lt;/code&gt; didn't make any changes to the &lt;code&gt;:dependents&lt;/code&gt; attribute.&lt;/p&gt;
&lt;p&gt;This seems like a mistake to me, as the &lt;code&gt;remove-node&lt;/code&gt; docstring reads:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Removes the node from the dependency graph without removing it as a&lt;br&gt;
dependency of other nodes. That is, removes all outgoing edges from&lt;br&gt;
node.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The implementation of &lt;code&gt;remove-node&lt;/code&gt; follows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(remove-node [graph node]
  (MapDependencyGraph.
    (dissoc dependencies node)
    dependents))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This removes outgoing edges from &lt;code&gt;dependencies&lt;/code&gt;, but if &lt;code&gt;dependents&lt;/code&gt; is effectively an inverse of &lt;code&gt;dependencies&lt;/code&gt;, then I'd expect to see some sort of removal from &lt;code&gt;dependents&lt;/code&gt; as well. Instead, &lt;code&gt;dependents&lt;/code&gt; remains unmodified.&lt;/p&gt;
&lt;h3&gt;Proposed Fix&lt;/h3&gt;
&lt;p&gt;If this is indeed a bug, and not a misunderstanding on my part, I have a fix &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/brandoncorrea/tools.namespace/commit/8ee0608a1885826ac862382c282e718bb4aae850&quot;&gt;here&lt;/a&gt; along with &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/brandoncorrea/tools.namespace/blob/behavioral-tests/src/test/clojure/clojure/tools/namespace/repl_test.clj#L56-L80&quot;&gt;a couple tests&lt;/a&gt; on my &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/brandoncorrea/tools.namespace/tree/behavioral-tests&quot;&gt;behavioral-tests branch&lt;/a&gt; that removes &lt;code&gt;node&lt;/code&gt; from values in the &lt;code&gt;dependents&lt;/code&gt; map.&lt;/p&gt;
&lt;p&gt;Does this align with the expected behavior of &lt;code&gt;remove-node&lt;/code&gt;, or am I misunderstanding the intended behavior of this function?&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14345/namespace-remove-remove-outgoing-dependencies-dependents</guid>
<pubDate>Mon, 20 Jan 2025 02:32:44 +0000</pubDate>
</item>
<item>
<title>unable to use add-lib on io.github.borkdude/grasp</title>
<link>https://ask.clojure.org/index.php/14342/unable-to-use-add-lib-on-io-github-borkdude-grasp</link>
<description>&lt;p&gt;repro:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;user=&amp;gt; (add-lib 'io.github.borkdude/grasp {:mvn/version &quot;0.1.4&quot;})
Execution error (ExceptionInfo) at clojure.tools.deps.interop/invoke-tool (interop.clj:81).
Could not find artifact org.clojure:clojure:jar:1.11.0-rc1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This seems strange to me. The deps edn of grasp: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/borkdude/grasp/blob/master/deps.edn&quot;&gt;https://github.com/borkdude/grasp/blob/master/deps.edn&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{:deps {org.babashka/sci {:mvn/version &quot;0.3.2&quot;}}
 :aliases {:native {:jvm-opts [&quot;-Dclojure.compiler.direct-linking=true&quot;]
                    :extra-deps {org.clojure/clojure {:mvn/version &quot;1.10.2-alpha3&quot;}
                                 org.clojure/tools.cli {:mvn/version &quot;1.0.194&quot;}}}
           :test {:extra-paths [&quot;test&quot;]
                  :extra-deps {org.clojure/clojure {:mvn/version &quot;1.11.0-rc1&quot;}
                               cognitect-labs/test-runner
                               {:git/url &quot;https://github.com/cognitect-labs/test-runner&quot;
                                :sha &quot;cb96e80f6f3d3b307c59cbeb49bb0dcb3a2a780b&quot;}}
                  :main-opts [&quot;-m&quot; &quot;cognitect.test-runner&quot;]}}}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It's surprising to me that deps in the &lt;code&gt;:test&lt;/code&gt; alias would cause issues.&lt;/p&gt;
&lt;p&gt;EDIT: seems to work now. Here's the stacktrace from a socket repl where i first encountered it&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;user=&amp;gt; (add-lib 'io.github.borkdude/grasp {:mvn/version &quot;0.1.4&quot;})
Execution error (ExceptionInfo) at clojure.tools.deps.interop/invoke-tool (interop.clj:81).
Could not find artifact org.clojure:clojure:jar:1.11.0-rc1
user=&amp;gt; nil
user=&amp;gt; (pst)
ExceptionInfo Could not find artifact org.clojure:clojure:jar:1.11.0-rc1 {:via [{:type clojure.lang.ExceptionInfo, :message &quot;Could not find artifact org.clojure:clojure:jar:1.11.0-rc1&quot;, :data {:lib org.clojure/clojure, :coord {:mvn/version &quot;1.11.0-rc1&quot;, :deps/manifest :mvn, :dependents [io.github.borkdude/grasp], :parents #{[io.github.borkdude/grasp]}}}, :at [clojure.tools.deps.extensions.maven$get_artifact invokeStatic &quot;maven.clj&quot; 167]}], :trace [[clojure.tools.deps.extensions.maven$get_artifact invokeStatic &quot;maven.clj&quot; 167] [clojure.tools.deps.extensions.maven$get_artifact invoke &quot;maven.clj&quot; 155] [clojure.tools.deps.extensions.maven$eval1225$fn__1228 invoke &quot;maven.clj&quot; 178] [clojure.lang.MultiFn invoke &quot;MultiFn.java&quot; 244] [clojure.tools.deps$download_libs$fn__802$fn__803 invoke &quot;deps.clj&quot; 466] [clojure.lang.AFn applyToHelper &quot;AFn.java&quot; 152] [clojure.lang.AFn applyTo &quot;AFn.java&quot; 144] [clojure.core$apply invokeStatic &quot;core.clj&quot; 667] [clojure.core$with_bindings_STAR_ invokeStatic &quot;core.clj&quot; 1990] [clojure.core$with_bindings_STAR_ doInvoke &quot;core.clj&quot; 1990] [clojure.lang.RestFn invoke &quot;RestFn.java&quot; 428] [clojure.lang.AFn applyToHelper &quot;AFn.java&quot; 156] [clojure.lang.RestFn applyTo &quot;RestFn.java&quot; 135] [clojure.core$apply invokeStatic &quot;core.clj&quot; 671] [clojure.core$bound_fn_STAR_$fn__5837 doInvoke &quot;core.clj&quot; 2020] [clojure.lang.RestFn invoke &quot;RestFn.java&quot; 400] [clojure.lang.AFn call &quot;AFn.java&quot; 18] [java.util.concurrent.FutureTask run &quot;FutureTask.java&quot; 317] [java.util.concurrent.ThreadPoolExecutor runWorker &quot;ThreadPoolExecutor.java&quot; 1144] [java.util.concurrent.ThreadPoolExecutor$Worker run &quot;ThreadPoolExecutor.java&quot; 642] [java.lang.Thread run &quot;Thread.java&quot; 1583]], :cause &quot;Could not find artifact org.clojure:clojure:jar:1.11.0-rc1&quot;, :data {:lib org.clojure/clojure, :coord {:mvn/version &quot;1.11.0-rc1&quot;, :deps/manifest :mvn, :dependents [io.github.borkdude/grasp], :parents #{[io.github.borkdude/grasp]}}}}
	clojure.tools.deps.interop/invoke-tool (interop.clj:81)
	clojure.tools.deps.interop/invoke-tool (interop.clj:41)
	clojure.repl.deps/add-libs (deps.clj:48)
	clojure.repl.deps/add-lib (deps.clj:59)
	clojure.repl.deps/add-lib (deps.clj:59)
	user/eval310956 (NO_SOURCE_FILE:320)
	user/eval310956 (NO_SOURCE_FILE:320)
	clojure.lang.Compiler.eval (Compiler.java:7700)
	clojure.lang.Compiler.eval (Compiler.java:7655)
	clojure.core/eval (core.clj:3232)
	clojure.core/eval (core.clj:3228)
	user/eval257807/fn--257810 (NO_SOURCE_FILE:8)
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>tools.deps</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14342/unable-to-use-add-lib-on-io-github-borkdude-grasp</guid>
<pubDate>Fri, 17 Jan 2025 14:15:15 +0000</pubDate>
</item>
<item>
<title>Incorrect docstring for parse-opts</title>
<link>https://ask.clojure.org/index.php/14275/incorrect-docstring-for-parse-opts</link>
<description>&lt;p&gt;In the docstring for &lt;code&gt;clojure.tools.cli/parse-opts&lt;/code&gt; (seen &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.github.io/tools.cli/#clojure.tools.cli/parse-opts&quot;&gt;here&lt;/a&gt;), it says,&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:id           The key for this option in the resulting option map. This
              is normally set to the keywordized name of the long option
              without the leading dashes.

              Multiple option entries can share the same :id in order to
              transform a value in different ways, but only one of these
              option entries may contain a :default(-fn) entry.

              This option is mandatory.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The final line says &quot;This option is mandatory.&quot; which is technically true for parse-opts' internals, but it's not true for users because (as the first paragraph says) &lt;code&gt;:id&lt;/code&gt; is also generated by keywordizing the long option.&lt;/p&gt;
&lt;p&gt;May I recommend changing it to be more explicit? Something like &quot;If a long option is not provided, this option is mandatory.&quot;&lt;/p&gt;
</description>
<category>tools.cli</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14275/incorrect-docstring-for-parse-opts</guid>
<pubDate>Tue, 03 Dec 2024 16:02:27 +0000</pubDate>
</item>
<item>
<title>Providing nil for long option in tools.cli does not seem to work per readme</title>
<link>https://ask.clojure.org/index.php/14260/providing-nil-for-long-option-tools-cli-does-seem-work-readme</link>
<description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;A very simplified tools.cli call:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(let [cli-opts [[&quot;-m&quot; &quot;--mode MODE&quot; &quot;Application mode&quot;]]]
  (cli/parse-opts [&quot;-m&quot; &quot;hub&quot;] cli-opts)) 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Evaluates as expected to:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{:options {:mode &quot;hub&quot;} ... }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;However, when I try to replace the long option with nil per the docs:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(let [cli-opts [[&quot;-m&quot; nil &quot;Application mode&quot; :id :mode]]]
  (cli/parse-opts [&quot;-m&quot; &quot;hub&quot;] cli-opts))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I get:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{:options {:mode true} :arguments [&quot;hub&quot;] ... }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I get the same behaviour with long option = &quot;&quot;, &quot;--mode&quot;, and &quot;MODE&quot;; the only way it seems to work is with the full &quot;--mode MODE&quot;. Setting the short option to nil works as I'd expect.&lt;/p&gt;
&lt;p&gt;Tested in Clojure 1.12.0, tools.cli 1.1.230, Java 23; same behaviour on Windows 11 and MacOS 15.&lt;/p&gt;
&lt;p&gt;Am I doing something wrong, or is tools.cli? :)&lt;/p&gt;
</description>
<category>tools.cli</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14260/providing-nil-for-long-option-tools-cli-does-seem-work-readme</guid>
<pubDate>Tue, 19 Nov 2024 22:03:50 +0000</pubDate>
</item>
<item>
<title>How can I ensure that a private Maven coordinate cannot be shadowed in a public repository?</title>
<link>https://ask.clojure.org/index.php/14198/ensure-private-coordinate-cannot-shadowed-public-repository</link>
<description>&lt;p&gt;Given a &lt;code&gt;deps.edn&lt;/code&gt; file with a &lt;code&gt;:mvn/repos&lt;/code&gt; entry for a private Maven repository and a dependency on a Maven coordinate that lives in that repository, how can I mitigate the risk of that coordinate getting shadowed / hijacked in one of the default public repositories?&lt;/p&gt;
&lt;p&gt;Possible solutions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Allow pinning a Maven dependency to a particular repository&lt;/li&gt;
&lt;li&gt;Allow declaring priority order of Maven repositories (in the example scenario, the private repository would then get the highest priority and always be checked before the other ones)&lt;/li&gt;
&lt;li&gt;Allow pinning a Maven dependency to a particular signing key and require it be signed (but looks like &lt;code&gt;tools.deps&lt;/code&gt; currently doesn't support verifying signed artifacts?)&lt;/li&gt;
&lt;/ul&gt;
</description>
<category>tools.deps</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14198/ensure-private-coordinate-cannot-shadowed-public-repository</guid>
<pubDate>Wed, 16 Oct 2024 11:08:07 +0000</pubDate>
</item>
<item>
<title>clojure.data.xml.event: EndElementEvent should provide tag and location-info</title>
<link>https://ask.clojure.org/index.php/14184/clojure-data-event-endelementevent-should-provide-location</link>
<description>&lt;p&gt;Additional information on the EndElementEvent would be very helpful, especially for processing large data in a streaming way.&lt;/p&gt;
&lt;p&gt;I would be happy to propose a patch – I've already signed the Contributor Agreement&lt;/p&gt;
</description>
<category>data.xml</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14184/clojure-data-event-endelementevent-should-provide-location</guid>
<pubDate>Thu, 10 Oct 2024 14:34:39 +0000</pubDate>
</item>
<item>
<title>clojure.data.priority-map's IKVReduce implementation doesn’t support `reduced`</title>
<link>https://ask.clojure.org/index.php/14149/clojure-priority-ikvreduce-implementation-support-reduced</link>
<description>&lt;p&gt;Hi folks! &lt;/p&gt;
&lt;p&gt;Just a heads-up that clojure.data.priority-map’s IKVReduce implementation doesn’t support &lt;code&gt;reduced&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The current implementation (v1.2.0, 2024-02-19):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;clojure.core.protocols/IKVReduce
(kv-reduce [this f init]
  (if keyfn            
    (reduce-kv (fn [a k v] (reduce (fn [a v] (f a v (item-&amp;gt;priority v))) a v))
      init priority-&amp;gt;set-of-items)
    (reduce-kv (fn [a k v] (reduce (fn [a v] (f a v k)) a v))
      init priority-&amp;gt;set-of-items)))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But the nested reduce means that something like this’d be needed:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defn- convey-reduced [x] (if (reduced? x) (reduced x) x))

clojure.core.protocols/IKVReduce
(kv-reduce [this f init]
  (if keyfn            
    (reduce-kv (fn [a k v] (reduce (fn [a v] (convey-reduced (f a v (item-&amp;gt;priority v))) a v)))
      init priority-&amp;gt;set-of-items)
    (reduce-kv (fn [a k v] (reduce (fn [a v] (convey-reduced (f a v k)) a v)))
      init priority-&amp;gt;set-of-items)))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note that the issue affects only &lt;code&gt;(reduce-kv a-priority-map …)&lt;/code&gt;, not &lt;code&gt;(reduce a-priority-map …)&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Thanks, cheers! :-)&lt;/p&gt;
</description>
<category>data.priority-map</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14149/clojure-priority-ikvreduce-implementation-support-reduced</guid>
<pubDate>Sat, 28 Sep 2024 23:52:55 +0000</pubDate>
</item>
<item>
<title>core.unify doesn't handle maps correctly</title>
<link>https://ask.clojure.org/index.php/14147/core-unify-doesnt-handle-maps-correctly</link>
<description>&lt;p&gt;core.unify does a classic approach to unification: in &lt;code&gt;garner-unifiers&lt;/code&gt;, it has a branch for sequential things, whereby it unifies the first elements of each sequence and then uses those bindings to unify the remaining bits:&lt;/p&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/core.unify/blob/master/src/main/clojure/clojure/core/unify.clj#L120&quot;&gt;https://github.com/clojure/core.unify/blob/master/src/main/clojure/clojure/core/unify.clj#L120&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(every? composite? [x y]) (garner-unifiers uv-fn
                                           variable?
                                           (rest x) 
                                           (rest y)
                                           (garner-unifiers uv-fn
                                                            variable?
                                                            (first x)
                                                            (first y) 
                                                            binds))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Maps also take this path. &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;unify=&amp;gt; (composite? {})
true
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The code then expects &lt;code&gt;first&lt;/code&gt; and &lt;code&gt;rest&lt;/code&gt; to get the sequence of the same keys (and unifiable values)  from both maps. This is not necessarily true. It's broken when keys have the same hash in a hashmap and it's broken when keys are in a different order when in an arraymap&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;unify=&amp;gt; (let [kws #{:a :b :c :d :e :f :g :h :i :dCv :wxW}]
          (assert (= (hash :dCv) (hash :wxW)))
          [(garner-unifiers (zipmap kws (repeat '?a))
                            (zipmap kws (repeat 1)))
           (garner-unifiers (zipmap kws (repeat '?a))
                            (zipmap (reverse kws) (repeat 1)))])
[{?a 1} nil]
unify=&amp;gt; [(garner-unifiers {:a '?a :b '?b} {:a 1 :b 2})
         (garner-unifiers {:a '?a :b '?b} {:b 2 :a 1})]
[{?a 1, ?b 2} nil]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Fun thread in #clojure : &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojurians.slack.com/archives/C03S1KBA2/p1727544444884499&quot;&gt;https://clojurians.slack.com/archives/C03S1KBA2/p1727544444884499&lt;/a&gt;&lt;br&gt;
And hat tip to p-himik who identified the minimal reproduction here.&lt;/p&gt;
</description>
<category>core.unify</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14147/core-unify-doesnt-handle-maps-correctly</guid>
<pubDate>Sat, 28 Sep 2024 19:55:39 +0000</pubDate>
</item>
<item>
<title>core.unify run-tests.sh file has an error</title>
<link>https://ask.clojure.org/index.php/14145/core-unify-run-tests-sh-file-has-an-error</link>
<description>&lt;p&gt;Two issues:&lt;br&gt;
- there is no artifact called 1.11.0-master-SNAPSHOT&lt;br&gt;
- it uses -A to invoke with main-opts&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;❯ ./run-tests.sh

[valid output]
...
Error building classpath. Could not find artifact org.clojure:clojure:jar:1.11.0-master-SNAPSHOT in central (https://repo1.maven.org/maven2/)

real	0m1.932s
user	0m2.018s
sys	0m0.132s
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;WARNING: Use of :main-opts with -A is deprecated. Use -M instead.

Running tests in #{&quot;src/test/clojure&quot;}

Testing with Clojure 1.10.1

Testing clojure.core.unify-test

Ran 12 tests containing 51 assertions.
0 failures, 0 errors.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The following patch quickly fixes both&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;diff --git a/deps.edn b/deps.edn
index d87033c..4d96956 100644
--- a/deps.edn
+++ b/deps.edn
@@ -7,7 +7,8 @@
            :1.8 {:override-deps {org.clojure/clojure {:mvn/version &quot;1.8.0&quot;}}}
            :1.9 {:override-deps {org.clojure/clojure {:mvn/version &quot;1.9.0&quot;}}}
            :1.10 {:override-deps {org.clojure/clojure {:mvn/version &quot;1.10.1&quot;}}}
-           :master {:override-deps {org.clojure/clojure {:mvn/version &quot;1.11.0-master-SNAPSHOT&quot;}}}
+           :1.11 {:override-deps {org.clojure/clojure {:mvn/version &quot;1.11.1&quot;}}}
+           :1.12 {:override-deps {org.clojure/clojure {:mvn/version &quot;1.12.0&quot;}}}
            :runner
            {:extra-deps {com.cognitect/test-runner
                          {:git/url &quot;https://github.com/cognitect-labs/test-runner&quot;
diff --git a/run-tests.sh b/run-tests.sh
index d0674d4..198907a 100755
--- a/run-tests.sh
+++ b/run-tests.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
-versions=&quot;1.6 1.7 1.8 1.9 1.10 master&quot;
+versions=&quot;1.6 1.7 1.8 1.9 1.10 1.11 1.12&quot;
 for v in $versions
 do
-  time clj -A:test:runner:$v
+  time clj -M:test:runner:$v
 done
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>core.unify</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14145/core-unify-run-tests-sh-file-has-an-error</guid>
<pubDate>Sat, 28 Sep 2024 14:20:35 +0000</pubDate>
</item>
<item>
<title>Accidental breaking change in data.json 2.5.0: previously, read succeeded, now it isn't</title>
<link>https://ask.clojure.org/index.php/14134/accidental-breaking-change-data-json-previously-succeeded</link>
<description>&lt;p&gt;Here is a snippet of code that fails on data.json 2.5.0:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;clj -Sdeps '{:deps {org.clojure/data.json {:mvn/version &quot;2.5.0&quot;}}}' -M -e '((requiring-resolve (quote clojure.data.json/read)) (clojure.lang.LineNumberingPushbackReader. (java.io.StringReader. &quot;[\n  {\n    \&quot;name\&quot;: \&quot;position\&quot;,\n    \&quot;type\&quot;: \&quot;float32\&quot;,\n    \&quot;count\&quot;: 3,\n    \&quot;data\&quot;: [0,0,0]\n  },\n  {\n    \&quot;name\&quot;: \&quot;normal\&quot;,\n    \&quot;type\&quot;: \&quot;float32\&quot;,\n    \&quot;count\&quot;: 3,\n    \&quot;data\&quot;: [0,0,0]\n  },\n  {\n    \&quot;name\&quot;: \&quot;texcoord0\&quot;,\n    \&quot;type\&quot;: \&quot;float32\&quot;,\n    \&quot;count\&quot;: 2,\n    \&quot;data\&quot;: [0,0]\n  }\n]&quot;)))'

Execution error (IOException) at java.io.PushbackReader/unread (PushbackReader.java:166).
Pushback buffer overflow
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The same code succeeds on 2.4.0:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;clj -Sdeps '{:deps {org.clojure/data.json {:mvn/version &quot;2.4.0&quot;}}}' -M -e '((requiring-resolve (quote clojure.data.json/read)) (clojure.lang.LineNumberingPushbackReader. (java.io.StringReader. &quot;[\n  {\n    \&quot;name\&quot;: \&quot;position\&quot;,\n    \&quot;type\&quot;: \&quot;float32\&quot;,\n    \&quot;count\&quot;: 3,\n    \&quot;data\&quot;: [0,0,0]\n  },\n  {\n    \&quot;name\&quot;: \&quot;normal\&quot;,\n    \&quot;type\&quot;: \&quot;float32\&quot;,\n    \&quot;count\&quot;: 3,\n    \&quot;data\&quot;: [0,0,0]\n  },\n  {\n    \&quot;name\&quot;: \&quot;texcoord0\&quot;,\n    \&quot;type\&quot;: \&quot;float32\&quot;,\n    \&quot;count\&quot;: 2,\n    \&quot;data\&quot;: [0,0]\n  }\n]&quot;)))'
[{&quot;name&quot; &quot;position&quot;, &quot;type&quot; &quot;float32&quot;, &quot;count&quot; 3, &quot;data&quot; [0 0 0]} {&quot;name&quot; &quot;normal&quot;, &quot;type&quot; &quot;float32&quot;, &quot;count&quot; 3, &quot;data&quot; [0 0 0]} {&quot;name&quot; &quot;texcoord0&quot;, &quot;type&quot; &quot;float32&quot;, &quot;count&quot; 2, &quot;data&quot; [0 0]}]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The gist of the problem: previously, Clojure's line numbering pushback reader could be used as an input to &lt;code&gt;read&lt;/code&gt;. Now it can't: it throws an exception.&lt;/p&gt;
&lt;p&gt;For reference, this is a json repro (a valid json!):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[
  {
    &quot;name&quot;: &quot;position&quot;,
    &quot;type&quot;: &quot;float32&quot;,
    &quot;count&quot;: 3,
    &quot;data&quot;: [0,0,0]
  },
  {
    &quot;name&quot;: &quot;normal&quot;,
    &quot;type&quot;: &quot;float32&quot;,
    &quot;count&quot;: 3,
    &quot;data&quot;: [0,0,0]
  },
  {
    &quot;name&quot;: &quot;texcoord0&quot;,
    &quot;type&quot;: &quot;float32&quot;,
    &quot;count&quot;: 2,
    &quot;data&quot;: [0,0]
  }
]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And, the formatted code: that uses the json:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(clojure.data.json/read 
  (clojure.lang.LineNumberingPushbackReader.
    (java.io.StringReader. &quot;...&quot;)))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It seems the problem is introduced in &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/DJSON-50&quot;&gt;https://clojure.atlassian.net/browse/DJSON-50&lt;/a&gt;&lt;/p&gt;
</description>
<category>data.json</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14134/accidental-breaking-change-data-json-previously-succeeded</guid>
<pubDate>Wed, 25 Sep 2024 15:46:20 +0000</pubDate>
</item>
<item>
<title>clj -X:deps find-versions prefers git deps if both git and mvn exist</title>
<link>https://ask.clojure.org/index.php/14106/clj-deps-find-versions-prefers-git-deps-both-git-and-mvn-exist</link>
<description>&lt;h2&gt;Environment&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;clj --version
Clojure CLI version 1.12.0.1479
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Source&lt;/h2&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://clojurians.slack.com/archives/C6QH853H8/p1726065319663009?thread_ts=1726063714.496649&amp;amp;cid=C6QH853H8&quot;&gt;A chat on Slack&lt;/a&gt; where we happened to notice the behaviour.&lt;/p&gt;
&lt;h2&gt;Scenario&lt;/h2&gt;
&lt;p&gt;When lib x is both a git dep and a maven dep,&lt;br&gt;
 &lt;code&gt;clj -X:deps find-versions :lib x&lt;/code&gt; shows only versions from git deps.&lt;/p&gt;
&lt;p&gt;Specific example: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/tools.build&quot;&gt;io.github.clojure/tools.build&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As a git dep:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;io.github.clojure/tools.build {:git/tag &quot;v0.10.5&quot; :git/sha &quot;2a21b7a&quot;}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As a Maven dep:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;io.github.clojure/tools.build {:mvn/version &quot;0.10.5&quot;}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Reproduction&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;clj -X:deps find-versions :lib io.github.clojure/tools.build
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Actual Behavior&lt;/h2&gt;
&lt;p&gt;Versions from git deps are listed:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{:git/tag &quot;v0.9.4&quot;, :git/sha &quot;76b78fe&quot;}
{:git/tag &quot;v0.9.5&quot;, :git/sha &quot;24f2894&quot;}
{:git/tag &quot;v0.9.6&quot;, :git/sha &quot;8e78bcc&quot;}
{:git/tag &quot;v0.10.0&quot;, :git/sha &quot;3a2c484&quot;}
{:git/tag &quot;v0.10.1&quot;, :git/sha &quot;5e3b8f3&quot;}
{:git/tag &quot;v0.10.3&quot;, :git/sha &quot;15ead66&quot;}
{:git/tag &quot;v0.10.4&quot;, :git/sha &quot;31388ff&quot;}
{:git/tag &quot;v0.10.5&quot;, :git/sha &quot;2a21b7a&quot;}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Expected Behavior&lt;/h2&gt;
&lt;p&gt;TBD by Alex, but note that although &lt;a rel=&quot;nofollow&quot; href=&quot;https://central.sonatype.com/artifact/io.github.clojure/tools.build/versions&quot;&gt;maven deps exist&lt;/a&gt;, they are not listed. &lt;/p&gt;
&lt;p&gt;A few ideas to poke at:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Idea One:  populate this list with all available versions:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{:mvn/version &quot;0.9.4&quot; :git/tag &quot;v0.9.4&quot;, :git/sha &quot;76b78fe&quot;}
{:mvn/version &quot;0.9.5&quot; :git/tag &quot;v0.9.5&quot;, :git/sha &quot;24f2894&quot;}
{:mvn/version &quot;0.9.6&quot; :git/tag &quot;v0.9.6&quot;, :git/sha &quot;8e78bcc&quot;}
{:mvn/version &quot;0.10.0&quot; :git/tag &quot;v0.10.0&quot;, :git/sha &quot;3a2c484&quot;}
{:mvn/version &quot;0.10.1&quot; :git/tag &quot;v0.10.1&quot;, :git/sha &quot;5e3b8f3&quot;}
{:mvn/version &quot;0.10.3&quot; git/tag &quot;v0.10.3&quot;, :git/sha &quot;15ead66&quot;}
{:mvn/version &quot;0.10.4&quot; :git/tag &quot;v0.10.4&quot;, :git/sha &quot;31388ff&quot;}
{:mvn/version &quot;0.10.5&quot; :git/tag &quot;v0.10.5&quot;, :git/sha &quot;2a21b7a&quot;}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But maybe that's a bit confusing for users copy/paste-wise.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Idea Two: list all available versions side by side:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{:mvn/version &quot;0.9.4&quot;} {:git/tag &quot;v0.9.4&quot;, :git/sha &quot;76b78fe&quot;}
{:mvn/version &quot;0.9.5&quot;} {:git/tag &quot;v0.9.5&quot;, :git/sha &quot;24f2894&quot;}
{:mvn/version &quot;0.9.6&quot;} {git/tag &quot;v0.9.6&quot;, :git/sha &quot;8e78bcc&quot;}
{:mvn/version &quot;0.10.0&quot;} {:git/tag &quot;v0.10.0&quot;, :git/sha &quot;3a2c484&quot;}
{:mvn/version &quot;0.10.1&quot;} {:git/tag &quot;v0.10.1&quot;, :git/sha &quot;5e3b8f3&quot;}
{:mvn/version &quot;0.10.3&quot;} {git/tag &quot;v0.10.3&quot;, :git/sha &quot;15ead66&quot;}
{:mvn/version &quot;0.10.4&quot;} {:git/tag &quot;v0.10.4&quot;, :git/sha &quot;31388ff&quot;}
{:mvn/version &quot;0.10.5&quot;} {:git/tag &quot;v0.10.5&quot;, :git/sha &quot;2a21b7a&quot;}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Idea Three: list all available versions sequentially&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{:mvn/version &quot;0.9.4&quot;} 
{:mvn/version &quot;0.9.5&quot;} 
{:mvn/version &quot;0.9.6&quot;} 
{:mvn/version &quot;0.10.0&quot;}
{:mvn/version &quot;0.10.1&quot;}
{:mvn/version &quot;0.10.3&quot;}
{:mvn/version &quot;0.10.4&quot;} 
{:mvn/version &quot;0.10.5&quot;} 
{:mvn/version &quot;0.9.4&quot; :git/tag &quot;v0.9.4&quot;, :git/sha &quot;76b78fe&quot;}
{:mvn/version &quot;0.9.5&quot; :git/tag &quot;v0.9.5&quot;, :git/sha &quot;24f2894&quot;}
{:mvn/version &quot;0.9.6&quot; :git/tag &quot;v0.9.6&quot;, :git/sha &quot;8e78bcc&quot;}
{:mvn/version &quot;0.10.0&quot; :git/tag &quot;v0.10.0&quot;, :git/sha &quot;3a2c484&quot;}
{:mvn/version &quot;0.10.1&quot; :git/tag &quot;v0.10.1&quot;, :git/sha &quot;5e3b8f3&quot;}
{:mvn/version &quot;0.10.3&quot; git/tag &quot;v0.10.3&quot;, :git/sha &quot;15ead66&quot;}
{:mvn/version &quot;0.10.4&quot; :git/tag &quot;v0.10.4&quot;, :git/sha &quot;31388ff&quot;}
{:mvn/version &quot;0.10.5&quot; :git/tag &quot;v0.10.5&quot;, :git/sha &quot;2a21b7a&quot;}
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>tools.deps</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14106/clj-deps-find-versions-prefers-git-deps-both-git-and-mvn-exist</guid>
<pubDate>Wed, 11 Sep 2024 20:16:33 +0000</pubDate>
</item>
<item>
<title>The cljs docstring of `clojure.core.async/promise-chan` does not mention that it returns the value repeatedly</title>
<link>https://ask.clojure.org/index.php/14088/docstring-clojure-promise-mention-returns-value-repeatedly</link>
<description>&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://clojurians.slack.com/archives/C03S1L9DN/p1724775264055089&quot;&gt;Question in slack&lt;/a&gt; about why a promise chan &quot;returns the result of the promise every time you call&quot;.&lt;/p&gt;
&lt;p&gt;The docstring in clj includes the phrase&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Consumers will block until either a value is placed in the channel or the&lt;br&gt;
  channel is closed, then return the value (or nil) forever.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is missing from the clojurescript version of the docstring:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Creates a promise channel with an optional transducer, and an optional&lt;br&gt;
  exception-handler. A promise channel can take exactly one value that consumers&lt;br&gt;
  will receive. Once full, puts complete but val is dropped (no transfer).&lt;br&gt;
  Consumers will block until either a value is placed in the channel or the&lt;br&gt;
  channel is closed. See chan for the semantics of xform and ex-handler.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/core.async/blob/aa6b951301fbdcf5a13cdaaecb4b1a908dc8a978/src/main/clojure/cljs/core/async.cljs#L76&quot;&gt;source&lt;/a&gt;&lt;/p&gt;
</description>
<category>core.async</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14088/docstring-clojure-promise-mention-returns-value-repeatedly</guid>
<pubDate>Tue, 27 Aug 2024 16:28:38 +0000</pubDate>
</item>
<item>
<title>tools.reader parse-symbol is too sloppy when reading new n-dimensional class array</title>
<link>https://ask.clojure.org/index.php/14065/tools-reader-parse-symbol-sloppy-reading-dimensional-class</link>
<description>&lt;p&gt;Tools.reader accepts this symbol: &lt;code&gt;MyClazz:/3&lt;/code&gt; while it does not accept the symbol &lt;code&gt;MyClass:&lt;/code&gt;. This seems inconsistent. That's the main subject of this &quot;ask&quot;.&lt;/p&gt;
&lt;p&gt;Incidentally I noticed that this commit &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/tools.reader/commit/31adc06cd56753ed5a3cd443cea32158ba68c45c#diff-11ba7fe0994caede16eeb1c6ed52fc3aba112849ce1fd23dff0b9fb72441a09fR111&quot;&gt;https://github.com/clojure/tools.reader/commit/31adc06cd56753ed5a3cd443cea32158ba68c45c#diff-11ba7fe0994caede16eeb1c6ed52fc3aba112849ce1fd23dff0b9fb72441a09fR111&lt;/a&gt; uses a regex + re-matches to check if the string &lt;code&gt;sym&lt;/code&gt; is a 1-sized numeric string. I noticed that this causes a slight performance regression compared to version 1.4.2. I think the check can be implemented using a somewhat more elaborate but more performant check:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;check if the string is of size 1&lt;/li&gt;
&lt;li&gt;only then check if that string represents a number between 1 and 9&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;E.g. this version seems to be roughly 6x faster than the re-matches approach:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;user=&amp;gt; (defn array-dim? [^String s] (and (= 1 (.length s)) (some-&amp;gt; (try (Integer/parseInt s) (catch Exception e nil)) pos?)))
#'user/array-dim?
user=&amp;gt; (time (dotimes [i 10000000] (array-dim? &quot;1&quot;)))
&quot;Elapsed time: 45.287416 msecs&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;user=&amp;gt; (defn array-dim2? [^String s] (re-matches #&quot;[1-9]&quot; s))
#'user/array-dim2?
user=&amp;gt; (time (dotimes [i 10000000] (array-dim2? &quot;1&quot;)))
&quot;Elapsed time: 304.30275 msecs&quot;
nil
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note how clojure's own reader implemented it:&lt;/p&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/clojure/commit/1fa5b038a434da34f787e3aec56f9cb48ed4dd99#diff-9216bc4fd055e0567fa034ec14a8ba470d36ba5be16418c8f2e2ebe1939bbb21R259&quot;&gt;https://github.com/clojure/clojure/commit/1fa5b038a434da34f787e3aec56f9cb48ed4dd99#diff-9216bc4fd055e0567fa034ec14a8ba470d36ba5be16418c8f2e2ebe1939bbb21R259&lt;/a&gt;&lt;/p&gt;
</description>
<category>tools.reader</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14065/tools-reader-parse-symbol-sloppy-reading-dimensional-class</guid>
<pubDate>Tue, 20 Aug 2024 19:17:17 +0000</pubDate>
</item>
<item>
<title>data.json :date-formatter does not support all the formats Cheshire :date-format does due to using Instant internally</title>
<link>https://ask.clojure.org/index.php/14049/formatter-support-formats-cheshire-format-instant-internally</link>
<description>&lt;p&gt;See Slack discussion here for the full background: &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojurians.slack.com/archives/C03S1KBA2/p1723222018579489&quot;&gt;https://clojurians.slack.com/archives/C03S1KBA2/p1723222018579489&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Problem statement:&lt;/p&gt;
&lt;p&gt;I have a &lt;code&gt;:date-format&lt;/code&gt; of &lt;code&gt;&quot;MMMM, dd yyyy HH:mm:ss Z&quot;&lt;/code&gt; that I use with Cheshire to turn various types of date/time values into JSON. In particular, &lt;code&gt;java.sql.Timestamp&lt;/code&gt; but also others. This works.&lt;/p&gt;
&lt;p&gt;I wanted to switch to &lt;code&gt;data.json&lt;/code&gt; so I provided &lt;code&gt;:date-formatter&lt;/code&gt; with &lt;code&gt;(DateTimeFormatter/ofPattern &quot;MMMM, dd yyyy HH:mm:ss Z&quot;)&lt;/code&gt; but it threw an exception because &lt;code&gt;data.json&lt;/code&gt; internally coerces date/time values to &lt;code&gt;java.time.Instant&lt;/code&gt; which doesn't support that pattern.&lt;/p&gt;
&lt;p&gt;Several possible solutions I considered:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;force users to manually convert those types themselves (avoiding that was the whole point of &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/DJSON-41&quot;&gt;DJSON-41&lt;/a&gt;) -- this is essentially &quot;do nothing&quot;&lt;/li&gt;
&lt;li&gt;provide an option to pre-transform &lt;code&gt;Instant&lt;/code&gt; to some other type prior to formatting (which gives the user control over zones/offsets etc)&lt;/li&gt;
&lt;li&gt;make existing &lt;code&gt;:date-formatter&lt;/code&gt; option &quot;smarter&quot; so it can accept a &lt;code&gt;DateTimeFormatter&lt;/code&gt; &lt;em&gt;or a user-supplied &lt;code&gt;Instant&lt;/code&gt; formatting function&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;change from &lt;code&gt;Instant&lt;/code&gt; to some other date/time type internally &lt;em&gt;in a way that is compatible with any formatting that &lt;code&gt;Instant&lt;/code&gt; already supports&lt;/em&gt; to allow for more variety of &lt;code&gt;DateTimeFormatter&lt;/code&gt; patterns&lt;/li&gt;
&lt;li&gt;...&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I worked around it by using &lt;code&gt;:value-fn&lt;/code&gt; but this means a runtime test on every value and manual conversion of date/time values to strings in user code...&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;1 goes against the whole point of adding date/time formatting support&lt;/li&gt;
&lt;li&gt;2 and 3 both add a small runtime overhead (3 would probably be my preference tho')&lt;/li&gt;
&lt;li&gt;4 might be tricky to completely support all existing formatting (I don't know) but might be the most seamless &quot;Cheshire compatibility&quot; path&lt;/li&gt;
&lt;/ul&gt;
</description>
<category>data.json</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14049/formatter-support-formats-cheshire-format-instant-internally</guid>
<pubDate>Fri, 09 Aug 2024 20:42:44 +0000</pubDate>
</item>
<item>
<title>How to suppress/capture the output of defspec for use in clojure.test?</title>
<link>https://ask.clojure.org/index.php/14040/how-suppress-capture-the-output-defspec-for-use-clojure-test</link>
<description>&lt;p&gt;I've been a fan of &lt;code&gt;test.check&lt;/code&gt; since the beginning. However, I've never found a convenient way to capture the output when using &lt;code&gt;defspec&lt;/code&gt;.  When used with &lt;code&gt;clojure.test&lt;/code&gt;, one gets output that looks like:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Testing tst.tupelo.y64
{:result true, :num-tests 999, :seed 1722976402694, :time-elapsed-ms 53, :test-var &quot;dospec-line-53&quot;}
{:result true, :num-tests 999, :seed 1722976402747, :time-elapsed-ms 36, :test-var &quot;dospec-line-44&quot;}&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;somewhat polluting the unit test output.  How can one capture and/or suppress this output?&lt;/p&gt;
</description>
<category>test.check</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14040/how-suppress-capture-the-output-defspec-for-use-clojure-test</guid>
<pubDate>Tue, 06 Aug 2024 20:41:33 +0000</pubDate>
</item>
<item>
<title>Is the clojure.cache behavior for lookup-or-miss value-fn re-entrancy broken or am I misunderstanding the docstring?</title>
<link>https://ask.clojure.org/index.php/14037/clojure-behavior-lookup-entrancy-misunderstanding-docstring</link>
<description>&lt;p&gt;I’m trying to reconcile clojure.cache behavior between what the docstring/code both suggest, and what I observe actually happening.  I am referring to this line:&lt;/p&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/core.cache/blob/99fbd669a429bc800ff32b64b21cf82b6b486f06/src/main/clojure/clojure/core/cache/wrapped.clj#L43&quot;&gt;https://github.com/clojure/core.cache/blob/99fbd669a429bc800ff32b64b21cf82b6b486f06/src/main/clojure/clojure/core/cache/wrapped.clj#L43&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;value-fn (and wrap-fn) will only be called (at most) once even in the &lt;br&gt;
case of retries, so there is no risk of cache stampede.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It seems quite trivial to get the value-fn to be called more than once when the cache is under contention.  I’ve emulated this behavior in the repl, as follows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(require '[clojure.core.cache.wrapped :as cache])
=&amp;gt; nil
(def c (cache/fifo-cache-factory {}))
=&amp;gt; #'user/c
(pmap (fn [_] (cache/lookup-or-miss c :foo (fn [k] (println &quot;miss&quot;) k))) (range 10))
miss
miss
miss
miss
miss
miss
miss
miss
=&amp;gt; (:foo :foo :foo :foo :foo :foo :foo :foo :foo :foo)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In this case, the miss function was invoked 8 out of 10 times when threads were competing.  I see this same behavior in the real world, too.&lt;/p&gt;
&lt;p&gt;What I don't fully understand is why when the swap! protects the call to c/through-cache. I'm guessing it has to do with how swap resolves conflicts. But if so, doesn't that mean the docstring is wrong?&lt;/p&gt;
&lt;p&gt;This is reproducible for me in both fifo and ttl caches.  I haven't tried the others.&lt;/p&gt;
</description>
<category>core.cache</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14037/clojure-behavior-lookup-entrancy-misunderstanding-docstring</guid>
<pubDate>Mon, 05 Aug 2024 17:56:40 +0000</pubDate>
</item>
<item>
<title>Fressian API Documentation</title>
<link>https://ask.clojure.org/index.php/14021/fressian-api-documentation</link>
<description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I wanted to link to the API documentation of &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/data.fressian&quot;&gt;https://github.com/clojure/data.fressian&lt;/a&gt;, but it seems to be down. The README links to the following Github Page: &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.github.com/data.fressian&quot;&gt;https://clojure.github.com/data.fressian&lt;/a&gt; which returns a 404. &lt;/p&gt;
&lt;p&gt;Can this be fixed?&lt;/p&gt;
&lt;p&gt;Thanks, Roman.&lt;/p&gt;
</description>
<category>data.fressian</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14021/fressian-api-documentation</guid>
<pubDate>Fri, 12 Jul 2024 10:25:32 +0000</pubDate>
</item>
<item>
<title>Support Clojure 1.12-alpha12 Array class notation</title>
<link>https://ask.clojure.org/index.php/13906/support-clojure-1-12-alpha12-array-class-notation</link>
<description>&lt;p&gt;Currently, the function &lt;code&gt;clojure.tools.reader.impl.commons/parse-symbol&lt;/code&gt; is fairly lax with what it allows, both in general and with regard to the forthcoming Clojure 1.12 Array class notation.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;user=&amp;gt; (mapv trc/parse-symbol [&quot;String/1&quot; &quot;String/-1&quot; &quot;String/11&quot; &quot;String/1a&quot;])
[nil [&quot;String&quot; &quot;-1&quot;] nil nil]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is different than the current implementation, which only accepts the first. Is there any interest in updating it to be stricter for the new notation?&lt;/p&gt;
</description>
<category>tools.reader</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13906/support-clojure-1-12-alpha12-array-class-notation</guid>
<pubDate>Thu, 23 May 2024 19:02:29 +0000</pubDate>
</item>
<item>
<title>Can someone `refer-clojure :exlude [abs]` in algo.generic</title>
<link>https://ask.clojure.org/index.php/13874/can-someone-refer-clojure-exlude-abs-in-algo-generic</link>
<description>&lt;p&gt;Simple request. &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/algo.generic/blob/master/src/main/clojure/clojure/algo/generic/math_functions.clj#L23&quot;&gt;https://github.com/clojure/algo.generic/blob/master/src/main/clojure/clojure/algo/generic/math_functions.clj#L23&lt;/a&gt; provides for an &lt;code&gt;abs&lt;/code&gt; function and so any usage of this library has a warning:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;WARNING: abs already refers to: #'clojure.core/abs in namespace: clojure.algo.generic.math-functions, being replaced by: #'clojure.algo.generic.math-functions/abs
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Happy to make a jira issue, or patch, or whatever is easiest to help this along.&lt;/p&gt;
&lt;p&gt;Repro:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;❯ clj -Sdeps '{:deps {org.clojure/algo.generic {:mvn/version &quot;LATEST&quot;}}}'
Clojure 1.11.2
user=&amp;gt; (require 'clojure.algo.generic.math-functions)
WARNING: abs already refers to: #'clojure.core/abs in namespace: clojure.algo.generic.math-functions, being replaced by: #'clojure.algo.generic.math-functions/abs
nil
user=&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>algo.generic</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13874/can-someone-refer-clojure-exlude-abs-in-algo-generic</guid>
<pubDate>Mon, 06 May 2024 23:04:37 +0000</pubDate>
</item>
<item>
<title>How to ignore :src-pom default for clojure.tools.build.api/write-pom if ./pom.xml exists?</title>
<link>https://ask.clojure.org/index.php/13802/ignore-pom-default-for-clojure-tools-build-api-write-exists</link>
<description>&lt;p&gt;I have a project that generates more than one jar artifact. For project A, I have &lt;code&gt;./pom.xml&lt;/code&gt; that is used as a template and everything works fine.&lt;/p&gt;
&lt;p&gt;For project B, I want to generate a pom.xml that's completely separate from project A which does not use ./pom.xml as a template. I generate the pom as follows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(require '[clojure.tools.build.api :as b])
(b/write-pom {:class-dir class-dir
                  :pom-data pom-data
                  :lib coord
                  :version version
                  :basis basis})
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;However, since &lt;code&gt;./pom.xml&lt;/code&gt; exists, it is used as a template. Explicitly passing &lt;code&gt;nil&lt;/code&gt; for &lt;code&gt;:src-pom&lt;/code&gt; doesn't help. The only workaround I could find was to pass in a bogus path for &lt;code&gt;:src-pom&lt;/code&gt;.&lt;/p&gt;
</description>
<category>tools.build</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13802/ignore-pom-default-for-clojure-tools-build-api-write-exists</guid>
<pubDate>Sun, 31 Mar 2024 20:50:22 +0000</pubDate>
</item>
</channel>
</rss>