<?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>Powered by Question2Answer</description>
<item>
<title>Allow for parsing invalid clojure code</title>
<link>https://ask.clojure.org/index.php/15263/allow-for-parsing-invalid-clojure-code</link>
<description>&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clj-commons/rewrite-clj/issues/87&quot;&gt;In a thread&lt;/a&gt; for the clojure source editing library rewrite-clj, we&#039;ve been discussing the possibility to allow for paring/reading technically invalid clojure data (symbols with multiple forward slashes, numbers with underscores or letters, unbalanced maps, etc).&lt;/p&gt;
&lt;p&gt;Given that &lt;code&gt;tools.reader&lt;/code&gt; is a foundational library for rewrite-clj and many other clojure source-focused libraries and tools, it seems worthwhile for all of us to share functionality instead of splitting off or all forking/reimplementing large parts of &lt;code&gt;tools.reader&lt;/code&gt; to achieve the same goals.&lt;/p&gt;
&lt;p&gt;Would there be interest in supporting reading technically invalid clojure code behind a config option or feature flag?&lt;/p&gt;
</description>
<category>tools.reader</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15263/allow-for-parsing-invalid-clojure-code</guid>
<pubDate>Sat, 17 Oct 2026 16:48:25 +0000</pubDate>
</item>
<item>
<title>tools.build/write-pom docstring could be clearer about prohibited keys</title>
<link>https://ask.clojure.org/index.php/15257/tools-build-write-docstring-could-clearer-about-prohibited</link>
<description>&lt;p&gt;The &lt;code&gt;tools.build/write-pom&lt;/code&gt; docstring &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/tools.build/blob/aef6defb060f73940d283e521b1379c05f414265/src/main/clojure/clojure/tools/build/api.clj#L399-L409&quot;&gt;advises which keys not to include for pom-data&lt;/a&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:pom-data - vector of hiccup-style extra pom top elements to include when
  :src-pom is :none or the source pom.xml does not exist:
   [[:licenses
     [:license
      [:name \&quot;Eclipse Public License 1.0\&quot;]
      [:url \&quot;https://opensource.org/license/epl-1-0/\&quot;]
      [:distribution \&quot;repo\&quot;]]]
    [:organization \&quot;Super Corp\&quot;]]
  The pom-data MUST NOT include:
    :modelVersion, :packaging, :groupId, :artifactId, :version, :name,
    :deps, :repositories, :build, or :scm
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &quot;MUST NOT include&quot; list might be a bit stale? If we are not working from a &lt;code&gt;pom.xml&lt;/code&gt;, we can include, for example, &lt;code&gt;:scm&lt;/code&gt;.  &lt;/p&gt;
&lt;p&gt;I noticed &lt;code&gt;:scm&lt;/code&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/seancorfield/next-jdbc/blob/7f76d8b24e7249b9183a6676fe1c2dc6c74455ca/build.clj#L23-L27&quot;&gt;usage on next.jdbc&lt;/a&gt;, and pinged Sean Corfield about it.&lt;br&gt;
He was kind enough to dig &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojurians.slack.com/archives/C02B5GHQWP4/p1696625954185059&quot;&gt;up an old Slack thread&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It was a bit confusing then, and it is still confusing now. &lt;br&gt;
In the spirit of being helpful to the community, I&#039;m raising this issue to consider a review of the  &lt;code&gt;write-pom&lt;/code&gt; docstring.&lt;/p&gt;
&lt;p&gt;I&#039;d recommend a clearer version, but I&#039;m unsure of what the rules really are.&lt;/p&gt;
</description>
<category>tools.build</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15257/tools-build-write-docstring-could-clearer-about-prohibited</guid>
<pubDate>Thu, 15 Oct 2026 15:35:47 +0000</pubDate>
</item>
<item>
<title>tools.deps shares one Maven DefaultModelValidator across threads, and dependency expansion fails at random</title>
<link>https://ask.clojure.org/index.php/15253/shares-defaultmodelvalidator-threads-dependency-expansion</link>
<description>&lt;p&gt;Dependency expansion sometimes fails with this error. We use Clojure CLI 1.12.5.1664 (tools.deps 0.31.1642):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;java.lang.ClassCastException: class java.util.HashMap$Node cannot be cast to class java.util.HashMap$TreeNode (java.util.HashMap$Node and java.util.HashMap$TreeNode are in module java.base of loader &#039;bootstrap&#039;)
    at java.base/java.util.HashMap$TreeNode.moveRootToFront(HashMap.java:1994)
    at java.base/java.util.HashMap$TreeNode.treeify(HashMap.java:2110)
    at java.base/java.util.HashMap.treeifyBin(HashMap.java:778)
    at java.base/java.util.HashMap.putVal(HashMap.java:650)
    at java.base/java.util.HashMap.put(HashMap.java:618)
    at java.base/java.util.HashSet.add(HashSet.java:229)
    at org.apache.maven.model.validation.DefaultModelValidator.validateId(DefaultModelValidator.java:1153)
    at org.apache.maven.model.validation.DefaultModelValidator.validateEffectiveDependency(DefaultModelValidator.java:888)
    at org.apache.maven.model.validation.DefaultModelValidator.validateEffectiveDependencies(DefaultModelValidator.java:776)
    at org.apache.maven.model.validation.DefaultModelValidator.validateEffectiveModel(DefaultModelValidator.java:487)
    at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:548)
    ...
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:183)
    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.readArtifactDescriptor(DefaultRepositorySystem.java:269)
    at clojure.tools.deps.extensions.maven$read_descriptor.invokeStatic(maven.clj:117)
    ...
    at clojure.tools.deps$expand_deps$children_task__976$fn__978$fn__979.invoke(deps.clj:303)
    ...
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This problem is probably the same as &lt;a rel=&quot;nofollow&quot; href=&quot;https://ask.clojure.org/index.php/15192/concurrency-bug-in-tools-deps-use-of-aether-maven-libs&quot;&gt;https://ask.clojure.org/index.php/15192/concurrency-bug-in-tools-deps-use-of-aether-maven-libs&lt;/a&gt;. The error at the end of that report is the same &lt;code&gt;HashMap$TreeNode&lt;/code&gt; error.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cause&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In Maven, &lt;code&gt;DefaultModelValidator&lt;/code&gt; is a singleton. It keeps valid ids in a plain &lt;code&gt;HashSet&lt;/code&gt; with the name &lt;code&gt;validIds&lt;/code&gt;. &lt;code&gt;validateId&lt;/code&gt; reads and writes this set without a lock. If two threads write to the set at the same time, the internal state of the &lt;code&gt;HashMap&lt;/code&gt; breaks. The &lt;code&gt;ClassCastException&lt;/code&gt; above is one result of this race condition. Maven 3.8.8 and Maven 3.9.16 both have this &lt;code&gt;HashSet&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;All expansion threads of tools.deps use the same validator:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In 0.31.1638 and later, &lt;code&gt;read-descriptor&lt;/code&gt; uses &lt;code&gt;session/retrieve&lt;/code&gt; for &lt;code&gt;:mvn/context&lt;/code&gt;, &lt;code&gt;:mvn/system&lt;/code&gt;, and &lt;code&gt;:mvn/session&lt;/code&gt;. Thus all threads share one context, one &lt;code&gt;RepositorySystem&lt;/code&gt;, and one validator.&lt;/li&gt;
&lt;li&gt;In 0.29.1598, each thread calls &lt;code&gt;session/retrieve-local&lt;/code&gt; to get its own &lt;code&gt;RepositorySystem&lt;/code&gt;. But &lt;code&gt;make-system&lt;/code&gt; gets the &lt;code&gt;RepositorySystem&lt;/code&gt; from one shared &lt;code&gt;DefaultServiceLocator&lt;/code&gt;, and the locator keeps one instance of each service. Because of this, all threads also get the same &lt;code&gt;RepositorySystem&lt;/code&gt;, the same model builder, and the same validator.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I did not examine versions 0.31.1619 to 0.31.1629, which use MIMA with &lt;code&gt;session/retrieve-local&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Upstream Maven status&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Maven fixed the &lt;code&gt;HashSet&lt;/code&gt; on &lt;code&gt;master&lt;/code&gt; only: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/apache/maven/issues/11618&quot;&gt;https://github.com/apache/maven/issues/11618&lt;/a&gt; and &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/apache/maven/pull/11734&quot;&gt;https://github.com/apache/maven/pull/11734&lt;/a&gt;. The &lt;code&gt;maven-3.9.x&lt;/code&gt; branch still has the plain &lt;code&gt;HashSet&lt;/code&gt;. Thus no Maven 3.9.x release has the fix.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Reproduction&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The failure does not occur on each run. It occurs only when the classpath is not in the cache. The dependency graph must also be large, so that several expansion threads read POMs at the same time.&lt;/p&gt;
&lt;p&gt;To make a failure more probable, use a project with many Maven dependencies. Run this command many times:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;clojure -Sforce -Spath
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Workaround&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;With one expansion thread, the race condition cannot occur:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;For the Clojure CLI, add &lt;code&gt;-Sthreads 1&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;For &lt;code&gt;clojure.tools.build.api/create-basis&lt;/code&gt;, add &lt;code&gt;:args {:threads 1}&lt;/code&gt;. For example: &lt;code&gt;(b/create-basis {:project &quot;deps.edn&quot; :args {:threads 1}})&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Versions&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Clojure CLI 1.12.5.1664 (tools.deps 0.31.1642, maven-model-builder 3.9.16, maven-resolver-provider 3.9.16)&lt;/li&gt;
&lt;li&gt;tools.build 0.10.13 (tools.deps 0.29.1598, maven-model-builder 3.8.8)&lt;/li&gt;
&lt;li&gt;The changelog of tools.deps 0.31.1646 shows no fix for this problem.&lt;/li&gt;
&lt;li&gt;macOS 26.6.2&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Possible fixes&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Give each expansion thread its own &lt;code&gt;RepositorySystem&lt;/code&gt;. Make each &lt;code&gt;RepositorySystem&lt;/code&gt; from its own service locator or MIMA context.&lt;/li&gt;
&lt;li&gt;When a Maven release keeps &lt;code&gt;validIds&lt;/code&gt; in a concurrent set, use that release.&lt;/li&gt;
&lt;/ul&gt;
</description>
<category>tools.deps</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15253/shares-defaultmodelvalidator-threads-dependency-expansion</guid>
<pubDate>Wed, 14 Oct 2026 13:42:34 +0000</pubDate>
</item>
<item>
<title>AVLMap does not implement isEmpty for java.util.Map</title>
<link>https://ask.clojure.org/index.php/15243/avlmap-does-not-implement-isempty-for-java-util-map</link>
<description>&lt;p&gt;The clojure.data.avl &lt;code&gt;AVLMap&lt;/code&gt; does not have an implementation for the &lt;code&gt;isEmpty&lt;/code&gt; method of the &lt;code&gt;java.util.Map&lt;/code&gt; interface.&lt;/p&gt;
&lt;p&gt;The cider debugger calls &lt;code&gt;isEmpty&lt;/code&gt; on instances of &lt;code&gt;java.util.Map&lt;/code&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure-emacs/orchard/blob/329ac7464e324758f3443918fe7598eca47327cf/src/orchard/print.clj#L242&quot;&gt;when printing values&lt;/a&gt; while stepping through execution. If the value is an &lt;code&gt;AVLMap&lt;/code&gt;, this throws an AbstractMethodError that prevents the debugger from working (see the stacktrace below).&lt;/p&gt;
&lt;p&gt;I have a workaround, which is to use a &lt;code&gt;:local/root&lt;/code&gt; version of clojure.data.avl with &lt;code&gt;isEmpty&lt;/code&gt; implemented.&lt;/p&gt;
&lt;p&gt;I have not checked if this problem exists on the CLJS implementation.&lt;/p&gt;
&lt;p&gt;I am on Clojure 1.12.4 and clojure.data.avl 0.2.1.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  Show: Project-Only All 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;  Hide: Clojure Java REPL Tooling Duplicates  (35 frames hidden)&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Unhandled java.lang.AbstractMethodError&lt;br&gt;
Method clojure/data/avl/AVLMap.isEmpty()Z is abstract&lt;pre&gt;&lt;code&gt;            avl.clj:   -1  clojure.data.avl.AVLMap/isEmpty
          print.clj:  166  orchard.print/print-map
          print.clj:  165  orchard.print/print-map
          print.clj:  174  orchard.print/eval46055/fn
       MultiFn.java:  234  clojure.lang.MultiFn/invoke
          print.clj:  301  orchard.print/print-str/fn
          print.clj:  301  orchard.print/print-str
          print.clj:  295  orchard.print/print-str
          debug.clj:  195  cider.nrepl.middleware.debug/pr-short
          debug.clj:  183  cider.nrepl.middleware.debug/pr-short
           core.clj: 7059  clojure.core/mapv/fn
      protocols.clj:   42  clojure.core.protocols/iterator-reduce!
      protocols.clj:   52  clojure.core.protocols/iter-reduce
      protocols.clj:   74  clojure.core.protocols/fn
      protocols.clj:   74  clojure.core.protocols/fn
      protocols.clj:   13  clojure.core.protocols/fn/G
           core.clj: 6965  clojure.core/reduce
           core.clj: 7050  clojure.core/mapv
           core.clj: 7050  clojure.core/mapv
           core.clj: 2641  clojure.core/partial/fn
           core.clj: 7059  clojure.core/mapv/fn
      protocols.clj:   42  clojure.core.protocols/iterator-reduce!
      protocols.clj:   52  clojure.core.protocols/iter-reduce
      protocols.clj:   74  clojure.core.protocols/fn
      protocols.clj:   74  clojure.core.protocols/fn
      protocols.clj:   13  clojure.core.protocols/fn/G
           core.clj: 6965  clojure.core/reduce
           core.clj: 7050  clojure.core/mapv
           core.clj: 7050  clojure.core/mapv
          debug.clj:  200  cider.nrepl.middleware.debug/locals-for-message
          debug.clj:  197  cider.nrepl.middleware.debug/locals-for-message
           core.clj: 6259  clojure.core/update
           core.clj: 6251  clojure.core/update
          debug.clj:  244  cider.nrepl.middleware.debug/read-debug-input
          debug.clj:  233  cider.nrepl.middleware.debug/read-debug-input
          debug.clj:  356  cider.nrepl.middleware.debug/read-debug-command
          debug.clj:  322  cider.nrepl.middleware.debug/read-debug-command
          debug.clj:  557  cider.nrepl.middleware.debug/break
          debug.clj:  535  cider.nrepl.middleware.debug/break
           Var.java:  401  clojure.lang.Var/invoke
  DebugSupport.java:   23  cider.nrepl.middleware.DebugSupport/doBreak
               REPL:  749  fredb.index.storage/eval82032/materialize
               REPL:  767  fredb.index.storage/eval82041
               REPL:  767  fredb.index.storage/eval82041
      Compiler.java: 7757  clojure.lang.Compiler/eval
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;   interruptible_eval.clj:  106  nrepl.middleware.interruptible-eval/evaluator/run/fn&lt;br&gt;
   interruptible_eval.clj:  101  nrepl.middleware.interruptible-eval/evaluator/run&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;        session.clj:  251  nrepl.middleware.session/session-exec/session-loop
 SessionThread.java:   21  nrepl.SessionThread/run
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
</description>
<category>data.avl</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15243/avlmap-does-not-implement-isempty-for-java-util-map</guid>
<pubDate>Thu, 08 Oct 2026 04:44:14 +0000</pubDate>
</item>
<item>
<title>Behavior when an alias is defined in multiple deps.edn might be surprising</title>
<link>https://ask.clojure.org/index.php/15242/behavior-when-alias-defined-multiple-deps-might-surprising</link>
<description>&lt;p&gt;&lt;strong&gt;Situation:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Define the &lt;strong&gt;same&lt;/strong&gt; alias in multiple &lt;code&gt;deps.edn&lt;/code&gt; locations—user, project, extra, i.e., via &lt;code&gt;-Sdeps&lt;/code&gt;—and then use it in a Clojure CLI invocation.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Behavior:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The definitions of that alias are &lt;em&gt;merged&lt;/em&gt; across the four sources.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why that might be surprising:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Per the &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.org/reference/clojure_cli#deps_sources&quot;&gt;CLI deps sources reference&lt;/a&gt; &quot;The merge &lt;em&gt;[of the EDN files]&lt;/em&gt; is essentially &lt;code&gt;merge-with merge&lt;/code&gt;, except for &lt;code&gt;:paths&lt;/code&gt; where only the last deps source &lt;code&gt;:paths&lt;/code&gt; is used.&quot;&lt;/p&gt;
&lt;p&gt;In addition, per the &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.org/reference/clojure_cli#aliases&quot;&gt;CLI deps aliases reference&lt;/a&gt; When &lt;strong&gt;multiple&lt;/strong&gt; aliases are provided, the attributes of each alias are merged together under a specific set of rules.&lt;/p&gt;
&lt;p&gt;Based on both of these, if you have a &lt;strong&gt;single&lt;/strong&gt; alias defined in multiple sources, you might expect a simple &quot;last definition wins&quot; behavior, since the second part doesn&#039;t apply, and the first part indicates &lt;code&gt;:aliases&lt;/code&gt; will be simply &lt;code&gt;merge&lt;/code&gt;&#039;d across the sources.&lt;/p&gt;
&lt;p&gt;However, in &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/tools.deps/blob/dec86fcce4787c0a778fee673bf1e9e03b1a304a/src/main/clojure/clojure/tools/deps.clj#L702-L705&quot;&gt;tools.deps&lt;/a&gt; we see that &lt;code&gt;create-basis&lt;/code&gt; takes the EDN maps from all four tiers, gets the &lt;code&gt;:aliases&lt;/code&gt; entry from each and does &lt;code&gt;merge-with merge&lt;/code&gt; on those.&lt;/p&gt;
&lt;p&gt;That&#039;s why the alias ends up with a &lt;code&gt;merge&lt;/code&gt; of its definitions. I don&#039;t think this is documented?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why does it happen?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I&#039;m not sure, but I suspect this is part of the &quot;aliases are &#039;just&#039; data&quot; aspect, where a project-level (and extra level) alias can override &lt;em&gt;parts&lt;/em&gt; of an &quot;earlier&quot; definition, from other source &lt;code&gt;deps.edn&lt;/code&gt; files.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Does it matter?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I ran into this experimenting with the new Clojure CLI REPL project. I added &lt;code&gt;:repl&lt;/code&gt;, &lt;code&gt;:serve&lt;/code&gt;, and &lt;code&gt;:attach&lt;/code&gt; aliases to my user &lt;code&gt;deps.edn&lt;/code&gt; and got a warning (about unnamed access) when starting the REPL. I added &lt;code&gt;:jvm-opts&lt;/code&gt; to &lt;code&gt;:repl&lt;/code&gt; but still got the warning. Later, I added &lt;code&gt;:jvm-opts&lt;/code&gt; to &lt;code&gt;:attach&lt;/code&gt; so at least connecting a subsequent client didn&#039;t get the warning.&lt;/p&gt;
&lt;p&gt;Then I noticed that using &lt;code&gt;:repl&lt;/code&gt; no longer produced the warning. I looked at the CLI REPL code and it spawns the client at the process level, using &lt;code&gt;clojure&lt;/code&gt; and specifying &lt;code&gt;-Sdeps&lt;/code&gt; with an alias of &lt;code&gt;:attach&lt;/code&gt; to provide the dependencies and &lt;code&gt;:main-opts&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;That means that any tooling that runs Clojure processes, expecting to define and then use an alias via &lt;code&gt;-Sdeps&lt;/code&gt; can be affected by whatever happens to be in a user&#039;s project or user &lt;code&gt;deps.edn&lt;/code&gt; file: if the user has the same named alias defined, the tooling gets a &lt;strong&gt;merged&lt;/strong&gt; alias, not just the one it specifies.&lt;/p&gt;
</description>
<category>tools.deps</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15242/behavior-when-alias-defined-multiple-deps-might-surprising</guid>
<pubDate>Sun, 04 Oct 2026 20:42:19 +0000</pubDate>
</item>
<item>
<title>int-map: difference ignores its second argument when the first is itself a difference result</title>
<link>https://ask.clojure.org/index.php/15241/difference-ignores-second-argument-itself-difference-result</link>
<description>&lt;pre&gt;&lt;code&gt;(require &#039;[clojure.data.int-map :as i])

(-&amp;gt; (i/int-set [10 1000297])
      (i/difference (i/int-set [10]))        ;=&amp;gt; #{1000297}
      (i/difference (i/int-set [1000297])))  ;=&amp;gt; #{1000297}, expected #{}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;When SingleContainer/difference removes its only element, it returns null.  IntSet/difference puts that null into the tree instead of dropping the key. In the next difference, the entry with the null value goes to the else branch, which is meant for k1 &amp;gt; k2. That branch moves i2 forward without comparing anything, so the rest of the first set gets copied as is.&lt;/p&gt;
&lt;p&gt;Skipping null values from the first set in that loop should fix it. So should not storing empty results in the first place. :)&lt;/p&gt;
</description>
<category>data.int-map</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15241/difference-ignores-second-argument-itself-difference-result</guid>
<pubDate>Fri, 02 Oct 2026 11:28:00 +0000</pubDate>
</item>
<item>
<title>LRUCache works as FIFOCache when composed with a TTLCache</title>
<link>https://ask.clojure.org/index.php/15233/lrucache-works-as-fifocache-when-composed-with-a-ttlcache</link>
<description>&lt;p&gt;When composing caches, hits are not propagated to inner caching layers. This makes, for example, a LRUCache work as a FIFOCache as it doesn&#039;t update its information about usage recency.&lt;/p&gt;
&lt;p&gt;This can be seen in the REPL reproduction below. &lt;code&gt;:b&lt;/code&gt; is evicted even though it had been accessed 3 times.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;user=&amp;gt; (require &#039;[clojure.core.cache :as cache])
nil
user=&amp;gt; (def c-cache (-&amp;gt; {:a 10 :b 20} 
                        (cache/lru-cache-factory :threshold 3) 
                        (cache/ttl-cache-factory :ttl 30000)))
#&#039;user/c-cache
user=&amp;gt; (def c-cache2 (cache/miss c-cache :c 30))
#&#039;user/c-cache2
user=&amp;gt; (cache/lookup c-cache2 :b)
20
user=&amp;gt; (cache/lookup c-cache2 :b)
20
user=&amp;gt; (cache/lookup c-cache2 :b)
20
user=&amp;gt; (cache/miss c-cache2 :d 40)
{:a 10, :c 30, :d 40}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In this example, either &lt;code&gt;:a&lt;/code&gt; or &lt;code&gt;:c&lt;/code&gt; should have been evicted.&lt;/p&gt;
</description>
<category>core.cache</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15233/lrucache-works-as-fifocache-when-composed-with-a-ttlcache</guid>
<pubDate>Wed, 09 Sep 2026 14:19:55 +0000</pubDate>
</item>
<item>
<title>Rose Tree Children Appear to be Eagerly Evaluated (Clojure 1.12+)</title>
<link>https://ask.clojure.org/index.php/15226/rose-tree-children-appear-to-be-eagerly-evaluated-clojure-12</link>
<description>&lt;p&gt;To make a long story shorter, I&#039;ve been aggressively profiling the generative tests I rely on on a daily basis. In CI, they run on memory-constrained machines which have occasionally ended up in OOM states that cause our test executor to kill the nodes running some generative tests. In many cases, we&#039;ve been able to adjust sizing to get under the line and resume normally. I&#039;ve been running into that case more frequently, and have been looking for potential causes/levers to adjust in the source code.&lt;/p&gt;
&lt;p&gt;The below findings are from my relatively powerful Macbook:&lt;/p&gt;
&lt;p&gt;Operating System: MacOS (Tahoe - AArch64)&lt;br&gt;
Clojure version: Verified on 1.12.1, Compared against 1.11.4&lt;br&gt;
JDK vendor and version: OpenJDK 21.0.11&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Using &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure-goes-fast/clj-async-profiler&quot;&gt;&lt;code&gt;clj-async-profiler&lt;/code&gt;&lt;/a&gt; and an allocation/timing macro from &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure-goes-fast.com/kb/benchmarking/time-plus/&quot;&gt;Clojure Goes Fast&lt;/a&gt;, I benchmarked &lt;code&gt;clojure.test.check.generators&lt;/code&gt; against some pretty common generators (Assume I&#039;m using &lt;code&gt;gen&lt;/code&gt; as an alias for that namespace):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;gen/string&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;gen/large-integer&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;(gen/map gen/keyword gen/string)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;While benchmarking, &lt;code&gt;ReentrantLock&lt;/code&gt; (and &lt;code&gt;ReentrantLock$NonfairSync&lt;/code&gt;), accounted for ~1/3rd of all allocations. Since Clojure 1.12, each &lt;code&gt;LazySeq&lt;/code&gt; also allocates a &lt;code&gt;ReentrantLock&lt;/code&gt;, so I reran the benchmarking after downgrading to Clojure 1.11.4 Obviously, all of those object references were no longer in the profiler results, but the amount of bytes allocated did consistently shrink (~10-15%, depending on the generator).&lt;/p&gt;
&lt;p&gt;Most of the allocation appears to be happening while constructing the children segments of nodes in the rose tree. To my knowledge, we only ever lean on the full tree when shrinking results, and wouldn&#039;t read them on a generate-only pass. To test that, I wrapped the &lt;code&gt;children&lt;/code&gt; arguments to a few of the &lt;code&gt;make-rose&lt;/code&gt; calls in the call tree for string generation, and re-instrumented on v.12.1&lt;/p&gt;
&lt;p&gt;This approximated the same reduction in memory use as downgrading to 1.11.4, and wiped out almost all of the &lt;code&gt;ReentrantLock&lt;/code&gt; allocation events. I&#039;ve been able to verify the fix does not break any tests, and that shrinking is functional as well.&lt;/p&gt;
&lt;p&gt;For posterity / reproduction, the specific call sites I wrapped the &lt;code&gt;children&lt;/code&gt; in were:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;clojure.test.check.rose-tree&lt;/code&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;join&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;fmap&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;shrink&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;shrink-vector*&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;clojure.test.check.generators&lt;/code&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;int-rose-tree&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;Happy to share the profiler output / git patch if anyone is interested!&lt;/p&gt;
</description>
<category>test.check</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15226/rose-tree-children-appear-to-be-eagerly-evaluated-clojure-12</guid>
<pubDate>Mon, 31 Aug 2026 18:18:35 +0000</pubDate>
</item>
<item>
<title>tools.reader project file version is outdated</title>
<link>https://ask.clojure.org/index.php/15209/tools-reader-project-file-version-is-outdated</link>
<description>&lt;p&gt;Hello! I noticed version currently defined in the tools.reader &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/tools.reader/blob/master/project.clj#L1&quot;&gt;project.clj file&lt;/a&gt; is out of date with respect to the &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/tools.reader/releases/tag/v1.6.0&quot;&gt;latest git tag&lt;/a&gt;. Would it be possible to keep those in sync? This situation is making packaging the library for Debian a bit more complicated than it needs to be. Thanks!&lt;/p&gt;
</description>
<category>tools.reader</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15209/tools-reader-project-file-version-is-outdated</guid>
<pubDate>Tue, 04 Aug 2026 02:36:36 +0000</pubDate>
</item>
<item>
<title>tools.build copy task does not respect non-replaced-exts</title>
<link>https://ask.clojure.org/index.php/15208/tools-build-copy-task-does-not-respect-non-replaced-exts</link>
<description>&lt;p&gt;It is not possible to tell &lt;code&gt;tools.build&lt;/code&gt; to copy files without substitution for a custom set of file extensions because the &lt;code&gt;copy&lt;/code&gt; function does not actually use its parameter (&lt;code&gt;non-replaced-exts&lt;/code&gt;) - it always uses &lt;code&gt;default-non-replaced-exts&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defn copy
  [{:keys [target-dir src-dirs include replace ignores non-replaced-exts]
    :or {include &quot;**&quot;, ignores default-ignores, non-replaced-exts default-non-replaced-exts}
    :as _params}]
  (let [to-path (.toPath (file/ensure-dir (api/resolve-path target-dir)))
        ignore-regexes (map re-pattern ignores)
        non-replaced (map #(str &quot;.&quot; %) default-non-replaced-exts)]
  ...)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The binding &lt;code&gt;non-replaced-exts&lt;/code&gt; exists and defaults to &lt;code&gt;default-non-replaced-exts&lt;/code&gt; but the function body never uses &lt;code&gt;non-replaced-exts&lt;/code&gt;: it has &lt;code&gt;default-non-replaced-exts&lt;/code&gt; hardcoded.&lt;/p&gt;
&lt;p&gt;A new feature in the next version of &lt;code&gt;deps-new&lt;/code&gt; depends on this working correctly.&lt;/p&gt;
</description>
<category>tools.build</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15208/tools-build-copy-task-does-not-respect-non-replaced-exts</guid>
<pubDate>Sun, 02 Aug 2026 15:39:16 +0000</pubDate>
</item>
<item>
<title>Concurrency bug in tools.deps use of Aether/Maven libs?</title>
<link>https://ask.clojure.org/index.php/15192/concurrency-bug-in-tools-deps-use-of-aether-maven-libs</link>
<description>&lt;p&gt;Occasionally, I&#039;ve been seeing this error:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;[org.eclipse.aether.internal.impl.DefaultTrackingFileManager] [] {} Failed to read tracking file &#039;/home/sean/.m2/repository/org/apache/maven/maven/3.8.8/_remote.repositories&#039;
java.nio.channels.ClosedChannelException&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;which leads to&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Expected HashMap$TreeNode, but was given HashMap$Node, at java.util.HashMap$TreeNode/moveRootToFront (HashMap.java:2020) - runtime error (unexpected type).&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;And the only solution seems to be to blow away part of the &lt;code&gt;~/.m2/repository&lt;/code&gt; and use &lt;code&gt;-Sforce&lt;/code&gt; to recompute/redownload.&lt;/p&gt;
&lt;p&gt;Any idea what might cause this sort of error? (Windows/WSL2, Ubuntu 20.04, all the very latest CLI/Clojure etc). See Slack thread for more discussion: &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojurians.slack.com/archives/C6QH853H8/p1784653752175769&quot;&gt;https://clojurians.slack.com/archives/C6QH853H8/p1784653752175769&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;More of the stacktrace:&lt;br&gt;
&lt;code&gt;`&lt;/code&gt;&lt;br&gt;
at java.base/sun.nio.ch.FileChannelImpl.ensureOpen(FileChannelImpl.java:169)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    at java.base/sun.nio.ch.FileChannelImpl.lock(FileChannelImpl.java:1676)
    at org.eclipse.aether.internal.impl.DefaultTrackingFileManager.fileLock(DefaultTrackingFileManager.java:171)
    at org.eclipse.aether.internal.impl.DefaultTrackingFileManager.read(DefaultTrackingFileManager.java:65)
    at org.eclipse.aether.internal.impl.EnhancedLocalRepositoryManager.readRepos(EnhancedLocalRepositoryManager.java:220)
    at org.eclipse.aether.internal.impl.EnhancedLocalRepositoryManager.checkFind(EnhancedLocalRepositoryManager.java:151)
    at org.eclipse.aether.internal.impl.EnhancedLocalRepositoryManager.find(EnhancedLocalRepositoryManager.java:128)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:360)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:261)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:243)
    at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:158)
    at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:204)
    at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:1035)
    at org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:827)
    at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:336)
    at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:248)
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:293)
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:183)
    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.readArtifactDescriptor(DefaultRepositorySystem.java:269)
    at clojure.tools.deps.extensions.maven$read_descriptor.invokeStatic(maven.clj:117)
    at clojure.tools.deps.extensions.maven$read_descriptor.invoke(maven.clj:108)
    at clojure.tools.deps.extensions.maven$eval61086$fn__61087.invoke(maven.clj:148)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;`&lt;/code&gt;&lt;/p&gt;
</description>
<category>tools.deps</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15192/concurrency-bug-in-tools-deps-use-of-aether-maven-libs</guid>
<pubDate>Tue, 21 Jul 2026 18:08:46 +0000</pubDate>
</item>
<item>
<title>core.unify does not preserve want-occurs? in recursive unify-variable calls</title>
<link>https://ask.clojure.org/index.php/15082/core-unify-preserve-occurs-recursive-unify-variable-calls</link>
<description>&lt;p&gt;core.unify does not preserve &lt;code&gt;want-occurs?&lt;/code&gt; when recursing from &lt;code&gt;unify-variable-&lt;/code&gt;. That is, if &lt;code&gt;unify-varable-&lt;/code&gt; calls &lt;code&gt;garner-unifiers&lt;/code&gt;, it does not pass itself as the &lt;code&gt;uv-fn&lt;/code&gt; parameter, so &lt;code&gt;garner-unifiers&lt;/code&gt; will default to &lt;code&gt;unify-variable&lt;/code&gt; (which includes an occurs? check). I&#039;m not sure if this was intentional, but I found it surprising. If not intentional, then I believe calls to &lt;code&gt;garner-unifiers&lt;/code&gt; in &lt;code&gt;create-var-unification-fn&lt;/code&gt; should look like:&lt;br&gt;
&lt;code&gt;(garner-unifiers ~&#039;var-unify ~varp vb# ~expr ~binds)&lt;/code&gt;&lt;/p&gt;
</description>
<category>core.unify</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15082/core-unify-preserve-occurs-recursive-unify-variable-calls</guid>
<pubDate>Sat, 16 May 2026 19:09:05 +0000</pubDate>
</item>
<item>
<title>Default implementation of AsElements to treat numbers as numbers, not strings</title>
<link>https://ask.clojure.org/index.php/15060/default-implementation-aselements-numbers-numbers-strings</link>
<description>&lt;p&gt;I&#039;m slowly converting some code from using &lt;code&gt;xml/element&lt;/code&gt; to &lt;code&gt;xml/sexp-as-element&lt;/code&gt;, and I&#039;ve noticed a discrepancy. &lt;code&gt;xml/element&lt;/code&gt; does (almost) no processing of the &quot;content&quot;, inserting it directly (unless it&#039;s &lt;code&gt;nil&lt;/code&gt;). &lt;code&gt;xml/sexp-as-element&lt;/code&gt; calls &lt;code&gt;(str)&lt;/code&gt; on the &quot;content&quot; if it&#039;s not seq of some kind (vector or ISeq) or a keyword. This means that &lt;code&gt;(= (xml/element :foo {} 1) (xml/sexp-as-element [:foo 1]))&lt;/code&gt; is false.&lt;/p&gt;
&lt;p&gt;There are probably other differences, but this one seems relatively big, as there&#039;s no way to use numbers in &lt;code&gt;xml/sexp-as-element&lt;/code&gt; without calling &lt;code&gt;extend-protocol&lt;/code&gt; yourself.&lt;/p&gt;
&lt;p&gt;May I recommend/request adding this extension? It will make &lt;code&gt;xml/sexp-as-element&lt;/code&gt; match &lt;code&gt;xml/element&lt;/code&gt; for numbers, and make &lt;code&gt;xml/sexp-as-element&lt;/code&gt; match hiccup in general.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(extend-protocol clojure.data.xml.protocols/AsElements
  java.lang.Number
  (as-elements [n] [n]))
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>data.xml</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15060/default-implementation-aselements-numbers-numbers-strings</guid>
<pubDate>Tue, 28 Apr 2026 16:10:26 +0000</pubDate>
</item>
<item>
<title>Is the recent change to flow&#039;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&#039;s futurize would rethrow any exceptions thrown by the function when deref&#039;ed. With the recent changes to return a CompletableFuture it no longer does that and instead if the function throws deref&#039;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 &#039;[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; #&#039;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 &#039;[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&#039;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&#039;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&#039;ve integrated java.doc into my IDE and it&#039;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&#039;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&#039;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&#039;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&#039;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&#039;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&#039;s assets will get clobbered and serve the wrong web page instead. Alternatively, flow monitoring may clobber someone else&#039;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&#039;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&#039;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&#039;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&#039;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&#039;s an absolute priority to not even change a formatting of the source code unless it&#039;s absolutely necessary, to keep very detailed compilation behavior or whatnot. It&#039;s a choice you made, it has its traidoffs, you chose those, and that&#039;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&#039;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&#039;t think that&#039;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&#039;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&#039;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&#039;ve got &lt;code&gt;{:mvn/version &quot;1.9.808-alpha1&quot;}&lt;/code&gt; in my deps.edn but I&#039;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 &#039;.*&#039;
&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&#039;m having a use case where I&#039;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&#039;t been able to figure how to use it. And haven&#039;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&#039;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&#039;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&#039;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 &#039;{:deps {org.clojure/tools.reader {:mvn/version &quot;1.5.0&quot;}}}&#039; \
        -M foo.clj &#039;:bip :bop&#039;
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 &#039;{:deps {org.clojure/tools.reader {:mvn/version &quot;1.5.0&quot;}}}&#039; \
        -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 &#039;{:deps {org.clojure/tools.reader {:mvn/version &quot;1.5.0&quot;}}}&#039; \
        -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 &#039;{:deps {org.clojure/tools.reader {:mvn/version &quot;1.5.0&quot;}}}&#039; \
        -M foo.clj &#039;(x)&#039;
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&#039;t see the issue:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ clojure -Sdeps &#039;{:deps {org.clojure/tools.reader {:mvn/version &quot;1.3.3&quot;}}}&#039; \
        -M foo.clj &#039;:bip :bop&#039;
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 &#039;{:deps {org.clojure/tools.reader {:mvn/version &quot;1.3.4&quot;}}}&#039; \
        -M foo.clj &#039;:bip :bop&#039;
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&#039;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&#039;re deferring to SOURCE_DATE_EPOCH whenever it&#039;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&#039;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&#039;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 &#039;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&#039;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&#039;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 &#039;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&#039;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&#039;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 &#039;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&#039; internals, but it&#039;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&#039;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&#039;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&#039;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&#039;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>
</channel>
</rss>