<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Recent activity in Clojure</title>
<link>https://ask.clojure.org/index.php/activity/clojure</link>
<description></description>
<item>
<title>Commented: Checked behavior in 1.13 destructuring outside of `:keys!` like directives</title>
<link>https://ask.clojure.org/index.php/15244/checked-behavior-destructuring-outside-keys-like-directives?show=15256#c15256</link>
<description>Thanks Sean, I didn't see your example on slack. However it clicked for me when Alex told me I can use both renaming and `:keys! [&amp;amp; ...]` with the same symbols. You can have your aliases made outside directives and check them using `:keys!`.&lt;br /&gt;
&lt;br /&gt;
This way the current implementation can do everything I describe -- except for the bad good idea of putting keywords in vars -- without adding new directives. Quite neat.</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15244/checked-behavior-destructuring-outside-keys-like-directives?show=15256#c15256</guid>
<pubDate>Thu, 15 Oct 2026 14:53:32 +0000</pubDate>
</item>
<item>
<title>Commented: Bytecode not 100% deterministic given identical inputs?</title>
<link>https://ask.clojure.org/index.php/12249/bytecode-not-100-deterministic-given-identical-inputs?show=15237#c15237</link>
<description>I've ran into similar problem, and it doesn't stop at the issue you described - RT.nextID() calls in gensym etc. inherently depend on global state.&lt;br /&gt;
&lt;br /&gt;
I do both AOT compiled class deployment to speed up loading Clojure code + implement hotfixes in production. Evaluating code at runtime where there has been less or more RT.nextID() calls causes interesting NoClassDefFoundError to pop up.</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12249/bytecode-not-100-deterministic-given-identical-inputs?show=15237#c15237</guid>
<pubDate>Wed, 16 Sep 2026 22:56:19 +0000</pubDate>
</item>
<item>
<title>Closed: Why gen-class does not generate default interface methods?</title>
<link>https://ask.clojure.org/index.php/13178/why-gen-class-does-not-generate-default-interface-methods?show=13178#q13178</link>
<description>&lt;p&gt;When using gen-class, the generated .class doesn't have the default methods from java interfaces.&lt;/p&gt;
&lt;p&gt;I created &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/ericdallo/clojure-sample/tree/clojure-gen-class-default-method&quot;&gt;this repro&lt;/a&gt;, you can confirm a exception is throw when trying to call the method from the generated class from gen-class:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;clj -T:build jar&lt;/code&gt; to generate the classes at target/classes&lt;/li&gt;
&lt;li&gt;&lt;code&gt;java -cp &lt;/code&gt;clj -Spath&lt;code&gt;  client/main/Main.java&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A exception is throw:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Exception in thread &quot;main&quot; java.lang.UnsupportedOperationException: otherthing (clojure-sample.foo/-otherthing not defined?)
    at clojure_sample.Foo.otherthing(Unknown Source)
    at client.main.Main.main(Main.java:9)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The not ideal workaround is to add the default method in the namespace implementing what is done in the default method inside the java interface.&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13178/why-gen-class-does-not-generate-default-interface-methods?show=13178#q13178</guid>
<pubDate>Wed, 02 Sep 2026 18:32:21 +0000</pubDate>
</item>
<item>
<title>Commented: Approach to case tableswitch may consume significant bytecode space</title>
<link>https://ask.clojure.org/index.php/15219/approach-tableswitch-consume-significant-bytecode-space?show=15225#c15225</link>
<description>Per &lt;a href=&quot;https://www.clojure.org/community/contributing#_reporting_problems_and_requesting_enhancements&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://www.clojure.org/community/contributing#_reporting_problems_and_requesting_enhancements&lt;/a&gt; ask.clojure.org is the place to discuss issues. Jira is specifically for contributors. That page overall discusses the whole process.</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15219/approach-tableswitch-consume-significant-bytecode-space?show=15225#c15225</guid>
<pubDate>Sun, 30 Aug 2026 21:58:52 +0000</pubDate>
</item>
<item>
<title>Answered: Some core predicates aren't generic over all types</title>
<link>https://ask.clojure.org/index.php/15216/some-core-predicates-arent-generic-over-all-types?show=15218#a15218</link>
<description>&lt;p&gt;I don't think that we can change the behavior of those predicates since code may rely on the throw. However, docstring updates could help with clarifying what happens when the preds are called with values that might throw.&lt;/p&gt;
</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15216/some-core-predicates-arent-generic-over-all-types?show=15218#a15218</guid>
<pubDate>Mon, 24 Aug 2026 14:32:48 +0000</pubDate>
</item>
<item>
<title>Commented: Add assoc-some for constructing maps while skipping nil values</title>
<link>https://ask.clojure.org/index.php/15184/add-assoc-some-for-constructing-maps-while-skipping-values?show=15214#c15214</link>
<description>Alex has mentioned the Jira ticket around assoc-some, but I'll also note—because I missed it at first—that 1.13 has introduced some-vals which produces a map without nil-valued keys (and can be used as a predicate, since if there are no non-nil-valued keys, you get back nil rather than {}):&lt;br /&gt;
&lt;br /&gt;
user=&amp;gt; (defn f [] nil)&lt;br /&gt;
#'user/f&lt;br /&gt;
user=&amp;gt; (def m {:a 1})&lt;br /&gt;
#'user/m&lt;br /&gt;
user=&amp;gt; (some-vals (assoc m :k (f)))&lt;br /&gt;
{:a 1}</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15184/add-assoc-some-for-constructing-maps-while-skipping-values?show=15214#c15214</guid>
<pubDate>Sun, 09 Aug 2026 14:50:49 +0000</pubDate>
</item>
<item>
<title>Commented: Why is clojure.core/derive not commutative?</title>
<link>https://ask.clojure.org/index.php/12878/why-is-clojure-core-derive-not-commutative?show=15213#c15213</link>
<description>This probably should have been a comment on the original question—it isn't an answer to the question.</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12878/why-is-clojure-core-derive-not-commutative?show=15213#c15213</guid>
<pubDate>Fri, 07 Aug 2026 01:06:36 +0000</pubDate>
</item>
<item>
<title>Edited: destructuring with :keys! and :or</title>
<link>https://ask.clojure.org/index.php/15179/destructuring-with-keys-and-or?show=15179#q15179</link>
<description>&lt;p&gt;I'm trying Clojure 1.13.0-alpha4.  I have a problem with :keys! and :or.  The first example works as expected with the old :keys.  The second example gives me a syntax error when I switch to the new :keys!.  The third example works when I avoid the required key in the defaults. &lt;/p&gt;
&lt;pre&gt;&lt;code&gt; (let [{:keys [a] :or {:a 1}} {:a 2}] a)
 ;=&amp;gt; 2
    
(let [{:keys! [a] :or {:a 1}} {:a 2}] a)
Syntax error macroexpanding let at (REPL:1:1).
Can't supply default value for required key: :a

(let [{:keys! [a] :or {:b 1}} {:a 2}] a)
;=&amp;gt; 2
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Syntax and reader</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15179/destructuring-with-keys-and-or?show=15179#q15179</guid>
<pubDate>Mon, 03 Aug 2026 21:18:14 +0000</pubDate>
</item>
<item>
<title>Commented: `(nth nil 10)` returns `nil` when it should throw</title>
<link>https://ask.clojure.org/index.php/15195/nth-nil-10-returns-nil-when-it-should-throw?show=15203#c15203</link>
<description>In general, there is a philosophy in Clojure core functions of aggressive polymorphism - making different types of collection (or nil) do something useful. For collection retrieval functions in particular, returning nil (rather than throwing) allows you to chain retrievals through deep data structures and bottom out at nil via the various &amp;quot;some&amp;quot; functions (like `some-&amp;gt;`) OR to do nil-punning conditional logic on nil.&lt;br /&gt;
&lt;br /&gt;
I've logged as &lt;a href=&quot;https://clojure.atlassian.net/browse/CLJ-2971&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2971&lt;/a&gt;</description>
<category>Collections</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15195/nth-nil-10-returns-nil-when-it-should-throw?show=15203#c15203</guid>
<pubDate>Thu, 23 Jul 2026 17:26:59 +0000</pubDate>
</item>
<item>
<title>Closed: When using remote prepl server, *repl* is false, preventing use of add-lib and related functions</title>
<link>https://ask.clojure.org/index.php/14374/using-remote-prepl-server-false-preventing-related-functions?show=14374#q14374</link>
<description>&lt;p&gt;To reproduce:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;clojure -J-Dclojure.server.jvm=&quot;{:port 5555 :accept clojure.core.server/io-prepl}&quot;

Clojure 1.12.0
user=&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;then&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nc localhost 5555
*repl*
{:tag :ret, :val &quot;false&quot;, :ns &quot;user&quot;, :ms 0, :form &quot;*repl*&quot;}
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14374/using-remote-prepl-server-false-preventing-related-functions?show=14374#q14374</guid>
<pubDate>Tue, 21 Jul 2026 19:32:37 +0000</pubDate>
</item>
<item>
<title>Closed: Improve javadoc especially for tool usage</title>
<link>https://ask.clojure.org/index.php/14715/improve-javadoc-especially-for-tool-usage?show=14715#q14715</link>
<description>&lt;p&gt;In order to provide a hot key in VS Code to show the JavaDocs associated with a selected form (class name or the type of an expression), I wrote the following Joyride script:&lt;/p&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/seancorfield/vscode-calva-setup/blob/develop/joyride/scripts/javadoc.cljs#L15&quot;&gt;https://github.com/seancorfield/vscode-calva-setup/blob/develop/joyride/scripts/javadoc.cljs#L15&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This highlights three issues that could be addressed/improved:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;On JDKs later than 15, the javadoc machinery falls back to JDK 8, unless you explicitly call &lt;code&gt;add-remote-javadoc&lt;/code&gt; for at least &lt;code&gt;java.&lt;/code&gt; and &lt;code&gt;javax.&lt;/code&gt;. This is a known issue that should be addressed in Clojure 1.13 per &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2920&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2920&lt;/a&gt; -- hopefully it will assume the URL structure for JDKs going forward so we don't run into this problem again, unless Oracle changes their URL structure again (hopefully, unlikely).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;javadoc-url&lt;/code&gt; is private so tools have to use &lt;code&gt;#'&lt;/code&gt; to access it, which makes it feel like this is just an implementation detail and subject to change. It would be nice for tools if this was part of the public, documented API for &lt;code&gt;clojure.java.javadoc&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Inner classes are not handled well. If you ask for the &lt;code&gt;javadoc-url&lt;/code&gt; for &lt;code&gt;java.util.Map$Entry&lt;/code&gt;, you get a URL with &lt;code&gt;Map$Entry.html&lt;/code&gt; which doesn't exist. Since inner classes are documented in their outer class, removing &lt;code&gt;$[a-zA-Z0-9_]+&lt;/code&gt; from the class name or from the URL would really help here.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Here's an example REPL session for Clojure 1.12.2 on JDK 24, showing these issues:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;user=&amp;gt; (clojure-version)
&quot;1.12.2&quot;
user=&amp;gt; (require 'clojure.java.javadoc)
nil
user=&amp;gt; (#'clojure.java.javadoc/javadoc-url &quot;java.util.concurrent.ExecutionException&quot;)
&quot;http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutionException.html&quot;
user=&amp;gt; (#'clojure.java.javadoc/javadoc-url &quot;java.util.Map$Entry&quot;)
&quot;http://docs.oracle.com/javase/8/docs/api/java/util/Map$Entry.html&quot;
user=&amp;gt; &lt;/code&gt;&lt;/p&gt;
</description>
<category>Java Interop</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14715/improve-javadoc-especially-for-tool-usage?show=14715#q14715</guid>
<pubDate>Tue, 21 Jul 2026 19:31:26 +0000</pubDate>
</item>
<item>
<title>Commented: Support for automatic promotion to BigDecimal in +', *', etc.</title>
<link>https://ask.clojure.org/index.php/14752/support-for-automatic-promotion-to-bigdecimal-in-etc?show=15178#c15178</link>
<description>It’s in the queue for 1.13</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14752/support-for-automatic-promotion-to-bigdecimal-in-etc?show=15178#c15178</guid>
<pubDate>Tue, 14 Jul 2026 03:49:51 +0000</pubDate>
</item>
<item>
<title>Answered: require yields confusing &quot;namespace ... not found after loading ...&quot; error if masked by empty test file</title>
<link>https://ask.clojure.org/index.php/15173/require-yields-confusing-namespace-found-after-loading-masked?show=15176#a15176</link>
<description>&lt;p&gt;I realize that I made a mistake, the test file should have been named &lt;code&gt;llm_test.clj&lt;/code&gt; instead of &lt;code&gt;llm.clj&lt;/code&gt;. Nevertheless the compiler error message could be more user-friendly, perhaps by including the full path to the problematic file.&lt;/p&gt;
</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15173/require-yields-confusing-namespace-found-after-loading-masked?show=15176#a15176</guid>
<pubDate>Tue, 14 Jul 2026 01:43:38 +0000</pubDate>
</item>
<item>
<title>Commented: Somewhat confusing sorted-set behavior</title>
<link>https://ask.clojure.org/index.php/11409/somewhat-confusing-sorted-set-behavior?show=15175#c15175</link>
<description>This issue bites us at least once or twice a year. The latest one is `(dissoc a-sorted-map :foo)`, which throws when `a-sorted-map` doesn't contain `:foo` instead of just returning `a-sorted-map` unchanged. A fix would be highly appreciated.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Use a different comparator&amp;quot; is often not an option because the sorted-map can come from code outside your control.&lt;br /&gt;
&lt;br /&gt;
Our workaround is using `(into (empty x) (remove #(= :foo (key %)) x)` instead of `dissoc`</description>
<category>Collections</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11409/somewhat-confusing-sorted-set-behavior?show=15175#c15175</guid>
<pubDate>Mon, 13 Jul 2026 21:49:41 +0000</pubDate>
</item>
<item>
<title>Answer selected: Additional handling for `&amp;` symbol in map destructuring for :keys/:syms/:strs could be a breaking change.</title>
<link>https://ask.clojure.org/index.php/15171/additional-handling-symbol-destructuring-breaking-change?show=15172#a15172</link>
<description>&lt;p&gt;Yes, the intent here is to carve this out of being allowed so it is available for syntax purposes in destructuring. We did a fair amount of searching and do not see this being used anywhere. &lt;/p&gt;
&lt;p&gt;We've updated the reference page at &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.org/reference/reader#_symbols&quot;&gt;https://clojure.org/reference/reader#_symbols&lt;/a&gt; to explicitly note this.&lt;/p&gt;
</description>
<category>Syntax and reader</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15171/additional-handling-symbol-destructuring-breaking-change?show=15172#a15172</guid>
<pubDate>Thu, 09 Jul 2026 16:08:08 +0000</pubDate>
</item>
<item>
<title>Commented: Namespaced map conversion fails when namespace keyword starts with a number</title>
<link>https://ask.clojure.org/index.php/15159/namespaced-conversion-fails-namespace-keyword-starts-number?show=15168#c15168</link>
<description>It is not valid Clojure, but it is not rejected in all situations, so it should not be relied on. There are some widely used Clojure libraries out there that assume it is not rejected in certain situations, so banning it is problematic—but also do not expect any changes that make it more widely accepted.</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15159/namespaced-conversion-fails-namespace-keyword-starts-number?show=15168#c15168</guid>
<pubDate>Mon, 06 Jul 2026 21:14:56 +0000</pubDate>
</item>
<item>
<title>Answered: Will :keys! work with nested maps?</title>
<link>https://ask.clojure.org/index.php/15160/will-keys-work-with-nested-maps?show=15166#a15166</link>
<description>&lt;p&gt;If we try that code in a REPL, we see that it complains about &lt;code&gt;:e&lt;/code&gt; being missing:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;user=&amp;gt; (let [sample-map {:a 1 :b {:a 2 :b 3 :c 4 :d 42}}
             {a :a {aa :a :as m :keys! [b c &amp;amp; d e]} :b} (dissoc sample-map :c)] b)
Execution error (IllegalArgumentException) at user/eval126 (REPL:1).
Missing required key: :e
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But the test is weird because &lt;code&gt;sample-map&lt;/code&gt; doesn't actually have a &lt;code&gt;:c&lt;/code&gt; key at the top level, only nested under &lt;code&gt;:b&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;In answer to your overall question, yes, &lt;code&gt;:keys!&lt;/code&gt; works anywhere that &lt;code&gt;:keys&lt;/code&gt; already works, and that includes nested map destructuring.&lt;/p&gt;
&lt;p&gt;Here's an example from our code at work:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  [{:keys! [worldsingles-application members actioner database]
    {:keys! [&amp;amp; redis-pubsub] pubsub :redis-pubsub} :worldsingles-application
    :as service}]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This checks that &lt;code&gt;:redis-pubsub&lt;/code&gt; is a key under &lt;code&gt;:worldsingles-application&lt;/code&gt; which is a key of &lt;code&gt;service&lt;/code&gt;, but does not bind &lt;code&gt;redis-pubsub&lt;/code&gt;, and also binds &lt;code&gt;pubsub&lt;/code&gt; to the &lt;code&gt;:redis-pubsub&lt;/code&gt; key. Yes, we have Alpha 2 in  production and this code used to be multiple &lt;code&gt;let&lt;/code&gt; bindings and explicit checks for keys being present.&lt;/p&gt;
</description>
<category>Test</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15160/will-keys-work-with-nested-maps?show=15166#a15166</guid>
<pubDate>Mon, 06 Jul 2026 16:08:02 +0000</pubDate>
</item>
<item>
<title>Closed: error printed using pprint in clojure 1.13.0-alpha1</title>
<link>https://ask.clojure.org/index.php/15153/error-printed-using-pprint-in-clojure-1-13-0-alpha1?show=15153#q15153</link>
<description>&lt;pre&gt;&lt;code&gt;❯ clj -Sdeps '{:deps {org.clojure/clojure {:mvn/version &quot;1.13.0-alpha1&quot;}}}'
Clojure 1.13.0-alpha1
user=&amp;gt; (clojure.pprint/pprint :foo)
Execution error (ClassCastException) at clojure.pprint.proxy$java.io.Writer$IDeref$PrettyFlush$4923d848/flush (REPL:-1).
class clojure.pprint.proxy$java.io.Writer$IDeref$PrettyFlush$4923d848 cannot be cast to class clojure.pprint.PrettyFlush (clojure.pprint.proxy$java.io.Writer$IDeref$PrettyFlush$4923d848 is in unnamed module of loader 'app'; clojure.pprint.PrettyFlush is in unnamed module of loader clojure.lang.DynamicClassLoader @36a58466)
:foo
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;reported by djblue in #clojure-dev&lt;/p&gt;
</description>
<category>Printing</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15153/error-printed-using-pprint-in-clojure-1-13-0-alpha1?show=15153#q15153</guid>
<pubDate>Fri, 03 Jul 2026 17:10:34 +0000</pubDate>
</item>
<item>
<title>Commented: Possibly avoidable identity call to force instance method on Class literals</title>
<link>https://ask.clojure.org/index.php/15155/possibly-avoidable-identity-force-instance-method-literals?show=15157#c15157</link>
<description>Why is this important?</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15155/possibly-avoidable-identity-force-instance-method-literals?show=15157#c15157</guid>
<pubDate>Fri, 03 Jul 2026 17:09:38 +0000</pubDate>
</item>
<item>
<title>Edited: Changing type tags can lead to cryptic errors</title>
<link>https://ask.clojure.org/index.php/15124/changing-type-tags-can-lead-to-cryptic-errors?show=15124#q15124</link>
<description>&lt;p&gt;Reporting this as an example of a particularly cryptic error message. Admittedly not the most common thing, but when doing REPL-driven dev with code that uses primitive type tags it can happen.&lt;/p&gt;
&lt;p&gt;The issue here as I understand it is that &lt;code&gt;IFn&lt;/code&gt; contains a few hundred interfaces with some permutation of primitive input and output types, with names like &lt;code&gt;LLO&lt;/code&gt; and &lt;code&gt;ODOL&lt;/code&gt;. Functions that call this are compiled to call the primitive interface to avoid boxing,rather than the generic IFn. If the function is then redefined without or with different primitive tags, then the compiled calling code is no longer calling the right interface.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defn foo ^long [^long x]
  x)

(defn bar []
  (+ (foo 3) (foo 4)))

(bar)

(defn foo [x] x)

(bar) ;;=&amp;gt; throws: class my.ns$foo cannot be cast to class  clojure.lang.IFn$LL
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15124/changing-type-tags-can-lead-to-cryptic-errors?show=15124#q15124</guid>
<pubDate>Fri, 03 Jul 2026 09:58:25 +0000</pubDate>
</item>
<item>
<title>Edited: Syntax-quoted lists can return nil, differs from ClojureScript</title>
<link>https://ask.clojure.org/index.php/15152/syntax-quoted-lists-can-return-differs-from-clojurescript?show=15152#q15152</link>
<description>&lt;p&gt;Syntax quoted lists can return &lt;code&gt;nil&lt;/code&gt; if only empty seqables are spliced into it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Clojure 1.12.5
user=&amp;gt; `(~@[])
nil
user=&amp;gt; `(~@[] ~@[])
nil
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;However, the implementation then ensures syntax-quoted empty lists are not nil:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Clojure 1.12.5
user=&amp;gt; `()
()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;ClojureScript returns an empty list in these cases:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;`(~@[])
=&amp;gt; ()
`(~@[] ~@[])
=&amp;gt; ()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The expansion of syntax quote itself is not necessarily a problem if it differs between platforms, but here the evaluation of the expansion differs. This can cause macros to behave differently between platforms (e.g., JVM Clojure vs bootstrapped cljs).&lt;/p&gt;
&lt;p&gt;This behavior seems to be present with all versions of Clojure &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/clojure/blob/f85444e6f890eb585e598efefdbd84727427e0a4/src/jvm/clojure/lang/LispReader.java#L731&quot;&gt;including 1.0.0&lt;/a&gt;, so perhaps the ship has sailed here. I went searching for an existing issue or documentation and AFAICT only &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-1425&quot;&gt;CLJ-1425&lt;/a&gt; mentions this oddity.&lt;/p&gt;
&lt;p&gt;The reference docs for &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.org/reference/reader#syntax-quote&quot;&gt;Syntax Quote&lt;/a&gt; also seem to contradict this behavior:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;For Lists/Vectors/Sets/Maps, syntax-quote establishes a template of the corresponding data structure.&lt;/p&gt;
&lt;/blockquote&gt;
</description>
<category>Syntax and reader</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15152/syntax-quoted-lists-can-return-differs-from-clojurescript?show=15152#q15152</guid>
<pubDate>Sun, 28 Jun 2026 21:35:41 +0000</pubDate>
</item>
<item>
<title>Closed: Why do literal vectors ignore type hinting?</title>
<link>https://ask.clojure.org/index.php/15136/why-do-literal-vectors-ignore-type-hinting?show=15136#q15136</link>
<description>&lt;p&gt;When calling a method on an instance of a Java class that takes a &lt;code&gt;Collection&amp;lt;? extends Something&amp;gt;&lt;/code&gt; as the argument, I've tried the following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(.theMethod ^SomeClass inst ^Collection [thing1 thing2])
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Unfortunately, when I'm using &lt;code&gt;lein check&lt;/code&gt; this gives me a reflection warning of:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;call to method theMethod on example.SomeClass can't be resolved (argument types: clojure.lang.IPersistentVector).
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I can fix this by binding it to a symbol with a type hint:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(let [^Collection things [thing1 thing2]]
  (.theMethod ^SomeClass inst things))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;What is going on that the literal vector can't be type-hinted in place?&lt;/p&gt;
</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15136/why-do-literal-vectors-ignore-type-hinting?show=15136#q15136</guid>
<pubDate>Mon, 22 Jun 2026 18:05:43 +0000</pubDate>
</item>
<item>
<title>Closed: Can't type hint literal collection containing runtime values</title>
<link>https://ask.clojure.org/index.php/4259/cant-type-hint-literal-collection-containing-runtime-values?show=4259#q4259</link>
<description>&lt;p&gt;Currently type hints on literals containing runtime values are lost:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;`&lt;/code&gt;&lt;br&gt;
user=&amp;gt; (set! &lt;em&gt;warn-on-reflection&lt;/em&gt; true)&lt;br&gt;
true&lt;br&gt;
user=&amp;gt; (fn [x] (java.util.HashMap. ^java.util.Map {&quot;foo&quot; x}))&lt;br&gt;
Reflection warning, null:1:9 - call to java.util.HashMap ctor can't be resolved.&lt;/p&gt;
&lt;h2&gt;function[user/eval7479/fn--7480]&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;`&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;A workaround that currently works is to introduce a local and type hint the binding&lt;/p&gt;
&lt;p&gt;&lt;code&gt;`&lt;/code&gt;&lt;br&gt;
user=&amp;gt; (fn [x] (let [^java.util.Map m {&quot;foo&quot; x}] (java.util.HashMap. m)))&lt;/p&gt;
&lt;h2&gt;function[user/eval7487/fn--7488]&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;`&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The attached patch fixes this issue by tracking type hints for literal values, making the reflection go away even in the original case&lt;/p&gt;
&lt;p&gt;&lt;code&gt;`&lt;/code&gt;&lt;br&gt;
user=&amp;gt; (set! &lt;em&gt;warn-on-reflection&lt;/em&gt; true)&lt;br&gt;
true&lt;br&gt;
user=&amp;gt; (fn [x] (java.util.HashMap. ^java.util.Map {&quot;foo&quot; x}))&lt;/p&gt;
&lt;h2&gt;function[user/eval7479/fn--7480]&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;`&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Approach:&lt;/strong&gt; preserve user hints in literal collections&lt;br&gt;
&lt;strong&gt;Patch&lt;/strong&gt;: 0001-CLJ-1929-preserve-type-hints-in-literals.patch&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/4259/cant-type-hint-literal-collection-containing-runtime-values?show=4259#q4259</guid>
<pubDate>Mon, 22 Jun 2026 18:05:06 +0000</pubDate>
</item>
<item>
<title>Answered: Why is aset at least 25 times faster than aset-long?</title>
<link>https://ask.clojure.org/index.php/15138/why-is-aset-at-least-25-times-faster-than-aset-long?show=15139#a15139</link>
<description>&lt;p&gt;We’ve spent a bunch of time on this and got into some surprising places with it. I am very much hoping all these set functions will be rewritten in next release.&lt;/p&gt;
</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15138/why-is-aset-at-least-25-times-faster-than-aset-long?show=15139#a15139</guid>
<pubDate>Mon, 15 Jun 2026 17:05:19 +0000</pubDate>
</item>
<item>
<title>Commented: Can clojure builds be reproducible? (new Debian forky requirement)</title>
<link>https://ask.clojure.org/index.php/15083/can-clojure-builds-reproducible-debian-forky-requirement?show=15133#c15133</link>
<description>Yes, you need to bootstrap Clojure 1.9+ using an existing version of Clojure, if you're compiling it.&lt;br /&gt;
&lt;br /&gt;
I have to admit, I still don't really understand why distros/package manager folks insist on trying to do this with things that are essentially just libraries on Maven Central? You risk creating builds of Clojure that are not the same as what the vast majority of people just download from Maven as project dependencies.</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15083/can-clojure-builds-reproducible-debian-forky-requirement?show=15133#c15133</guid>
<pubDate>Fri, 12 Jun 2026 16:15:43 +0000</pubDate>
</item>
<item>
<title>Closed: Implement reader literal and print support for PersistentQueue data structure</title>
<link>https://ask.clojure.org/index.php/3365/implement-reader-literal-support-persistentqueue-structure?show=3365#q3365</link>
<description>&lt;p&gt;Clojure's PersistentQueue structure has been in the language for quite some time now and has found its way into a fair share of codebases. However, the creation of queues is a two step operation often of the form:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;`&lt;/code&gt;&lt;br&gt;
(conj clojure.lang.PersistentQueue/EMPTY :a :b :c)&lt;/p&gt;
&lt;p&gt;;=&amp;gt; #&lt;br&gt;
&lt;code&gt;`&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;A better experience might be the following:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;`&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;queue [:a :b :c]&lt;/h2&gt;
&lt;p&gt;;=&amp;gt; #queue [:a :b :c]&lt;/p&gt;
&lt;p&gt;(pop #queue [:a :b :c])&lt;/p&gt;
&lt;p&gt;;=&amp;gt; #queue [:b :c]&lt;br&gt;
&lt;code&gt;`&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This syntax is proposed and discussed in the Clojure-dev group at &lt;a rel=&quot;nofollow&quot; href=&quot;https://groups.google.com/forum/?fromgroups#!topic/clojure-dev/GQqus5Wycno&quot;&gt;https://groups.google.com/forum/?fromgroups#!topic/clojure-dev/GQqus5Wycno&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Open question: Should the queue literal's arguments eval?  The implications of this are illustrated below:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;`&lt;/code&gt;&lt;br&gt;
;; non-eval case&lt;/p&gt;
&lt;h2&gt;queue [1 2 (+ 1 2)]&lt;/h2&gt;
&lt;p&gt;;=&amp;gt; #queue [1 2 (+ 1 2)]&lt;/p&gt;
&lt;p&gt;;; eval case&lt;/p&gt;
&lt;h2&gt;queue [1 2 (+ 1 2)]&lt;/h2&gt;
&lt;p&gt;;=&amp;gt; #queue [1 2 3]&lt;br&gt;
&lt;code&gt;`&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The answer to this open question will determine the implementation.&lt;/p&gt;
</description>
<category>Syntax and reader</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/3365/implement-reader-literal-support-persistentqueue-structure?show=3365#q3365</guid>
<pubDate>Tue, 09 Jun 2026 22:58:49 +0000</pubDate>
</item>
<item>
<title>Commented: Consider including a built-in wrapper around `java.net.http.HttpClient` in future versions of Clojure</title>
<link>https://ask.clojure.org/index.php/15129/consider-including-wrapper-around-httpclient-versions-clojure?show=15130#c15130</link>
<description>Here are a few more libraries that are light wrappers over the jdk HttpClient. Notably they expose a way to send a response body handler with the request, as HttpClient does.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://github.com/exoscale/telex&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://github.com/exoscale/telex&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://github.com/onionpancakes/hop&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://github.com/onionpancakes/hop&lt;/a&gt;</description>
<category>Java Interop</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15129/consider-including-wrapper-around-httpclient-versions-clojure?show=15130#c15130</guid>
<pubDate>Mon, 08 Jun 2026 15:35:28 +0000</pubDate>
</item>
<item>
<title>Answered: Object.clone() confusion</title>
<link>https://ask.clojure.org/index.php/15125/object-clone-confusion?show=15128#a15128</link>
<description>&lt;p&gt;clone() is a protected method - you should generally not call it on an arbitrary object.  In Java, you can't even make that call, you'll get &quot;clone() has protected access in java.lang.Object&quot;. It's a quirk of Clojure's impl that it even makes it possible via reflection. &lt;/p&gt;
&lt;p&gt;So, my suggestion is to not call clone() at all. There are many, many reasons clone() is problematic and considered one of the more questionable features of Java's early design.&lt;/p&gt;
</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15125/object-clone-confusion?show=15128#a15128</guid>
<pubDate>Sat, 06 Jun 2026 00:06:59 +0000</pubDate>
</item>
<item>
<title>Commented: `eval` using functions with metadata</title>
<link>https://ask.clojure.org/index.php/15115/eval-using-functions-with-metadata?show=15122#c15122</link>
<description>#= is undocumented because it is not intended to be used outside the compiler.</description>
<category>Syntax and reader</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15115/eval-using-functions-with-metadata?show=15122#c15122</guid>
<pubDate>Thu, 04 Jun 2026 02:35:24 +0000</pubDate>
</item>
<item>
<title>Request: allow a user function to be specified as the target of clojure.main/report-error</title>
<link>https://ask.clojure.org/index.php/15120/request-allow-function-specified-target-clojure-report-error</link>
<description>&lt;p&gt;The three current targets (&lt;code&gt;file&lt;/code&gt;, &lt;code&gt;none&lt;/code&gt;, &lt;code&gt;stderr&lt;/code&gt;) all serialize all of the error data to a string. During development, it would be convenient to be able to define a function that is called with the exception instance. This function might capture additional application state, or open a window in the user's editor, etc.&lt;/p&gt;
&lt;p&gt;Note that it is not possible to work around this by replacing &lt;code&gt;report-error&lt;/code&gt; itself because the entire clojure.main namespace is AOT-compiled, so &lt;code&gt;alter-var-root&lt;/code&gt; has no effect.&lt;/p&gt;
&lt;p&gt;See &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure-emacs/cider/issues/3850&quot;&gt;https://github.com/clojure-emacs/cider/issues/3850&lt;/a&gt; for an example where this feature would be helpful.&lt;/p&gt;
&lt;p&gt;Related Slack thread: &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojurians.slack.com/archives/C03S1KBA2/p1779991120304049&quot;&gt;https://clojurians.slack.com/archives/C03S1KBA2/p1779991120304049&lt;/a&gt;&lt;/p&gt;
</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15120/request-allow-function-specified-target-clojure-report-error</guid>
<pubDate>Tue, 02 Jun 2026 23:53:32 +0000</pubDate>
</item>
<item>
<title>Answered: :or destructuring doesn't update object</title>
<link>https://ask.clojure.org/index.php/13141/or-destructuring-doesnt-update-object?show=15118#a15118</link>
<description>&lt;p&gt;I logged an improvement request for this here, happy to collect more ideas here. &lt;/p&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2957&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2957&lt;/a&gt;&lt;/p&gt;
</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13141/or-destructuring-doesnt-update-object?show=15118#a15118</guid>
<pubDate>Mon, 01 Jun 2026 17:45:30 +0000</pubDate>
</item>
<item>
<title>Commented: Should reduce-kv support String?</title>
<link>https://ask.clojure.org/index.php/15109/should-reduce-kv-support-string?show=15114#c15114</link>
<description>i agree that it matching nth would be the most consistent.</description>
<category>Protocols</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15109/should-reduce-kv-support-string?show=15114#c15114</guid>
<pubDate>Mon, 01 Jun 2026 00:49:45 +0000</pubDate>
</item>
<item>
<title>Commented: `(:k m)` returns `nil` while `(identical? (first (keys m)) :k)` is `true` — two coexisting `Keyword` instances?</title>
<link>https://ask.clojure.org/index.php/15073/returns-while-identical-first-coexisting-keyword-instances?show=15107#c15107</link>
<description>Follow up discussion is happening on this thread on the Clojurians Slack: &lt;a href=&quot;https://clojurians.slack.com/archives/C03S1KBA2/p1779097281433139&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojurians.slack.com/archives/C03S1KBA2/p1779097281433139&lt;/a&gt;</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15073/returns-while-identical-first-coexisting-keyword-instances?show=15107#c15107</guid>
<pubDate>Wed, 27 May 2026 10:02:45 +0000</pubDate>
</item>
<item>
<title>Closed: Consider allowing passing two arguments to sets used as functions</title>
<link>https://ask.clojure.org/index.php/15104/consider-allowing-passing-two-arguments-sets-used-functions?show=15104#q15104</link>
<description>&lt;p&gt;Similar to how &lt;code&gt;get&lt;/code&gt; works with the 3rd &lt;code&gt;not-found&lt;/code&gt; argument.&lt;/p&gt;
&lt;p&gt;It already works in CLJS:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ClojureScript 1.12.116
cljs.user=&amp;gt; (#{:a} :b :c)
:c
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In Clojure, it errors out:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Clojure 1.12.0
user=&amp;gt; (#{:a} :b :c)
Execution error (ArityException) at user/eval1 (REPL:1).
Wrong number of args (2) passed to: clojure.lang.PersistentHashSet
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15104/consider-allowing-passing-two-arguments-sets-used-functions?show=15104#q15104</guid>
<pubDate>Tue, 26 May 2026 13:56:17 +0000</pubDate>
</item>
<item>
<title>Commented: The behavior of `filter` on infinite sequences in Transducers</title>
<link>https://ask.clojure.org/index.php/15095/the-behavior-of-filter-on-infinite-sequences-in-transducers?show=15103#c15103</link>
<description>If you know you're dealing with infinite sequences, that's the use case for lazy operations -- just don't use transducers on them.</description>
<category>Transducers</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15095/the-behavior-of-filter-on-infinite-sequences-in-transducers?show=15103#c15103</guid>
<pubDate>Mon, 25 May 2026 12:20:42 +0000</pubDate>
</item>
<item>
<title>Answer selected: Reflection warning when long hint on an argument</title>
<link>https://ask.clojure.org/index.php/15067/reflection-warning-when-long-hint-on-an-argument?show=15068#a15068</link>
<description>&lt;p&gt;It's the same thing as in &lt;a rel=&quot;nofollow&quot; href=&quot;https://ask.clojure.org/index.php/13501/primitive-type-hints-arguments-turns-the-return-value-object&quot;&gt;https://ask.clojure.org/index.php/13501/primitive-type-hints-arguments-turns-the-return-value-object&lt;/a&gt;.&lt;/p&gt;
</description>
<category>Java Interop</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15067/reflection-warning-when-long-hint-on-an-argument?show=15068#a15068</guid>
<pubDate>Fri, 08 May 2026 10:11:04 +0000</pubDate>
</item>
<item>
<title>Comment edited: Do primitive type hints in fn arguments turns the return value as an Object?</title>
<link>https://ask.clojure.org/index.php/13501/primitive-type-hints-arguments-turns-the-return-value-object?show=15071#c15071</link>
<description>Indeed @alexmiller, it seems the same issue as &lt;a href=&quot;https://ask.clojure.org/index.php/15067/reflection-warning-when-long-hint-on-an-argument&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://ask.clojure.org/index.php/15067/reflection-warning-when-long-hint-on-an-argument&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Was there any reason why this didn't go forward? Is it more involved than a simple bugfix? Asking because I cannot see the ticket.</description>
<category>Java Interop</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13501/primitive-type-hints-arguments-turns-the-return-value-object?show=15071#c15071</guid>
<pubDate>Sat, 02 May 2026 11:07:04 +0000</pubDate>
</item>
<item>
<title>Closed: Unroll constantly to improve performance of multi-arity calls</title>
<link>https://ask.clojure.org/index.php/1894/unroll-constantly-to-improve-performance-multi-arity-calls?show=1894#q1894</link>
<description>This was found to be a hot spot when testing some Specter use cases.&lt;br /&gt;
&lt;br /&gt;
Review of common uses of constantly shows that the arity 1 case is the most common use of `constantly` in the wild, so only unrolled to two arguments.&lt;br /&gt;
&lt;br /&gt;
Perf test:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(use 'criterium.core)&lt;br /&gt;
(def f (constantly 1))&lt;br /&gt;
(bench (dotimes [_ 1000] (f)))&lt;br /&gt;
(bench (dotimes [_ 1000] (f 1)))&lt;br /&gt;
(bench (dotimes [_ 1000] (f 1 2)))&lt;br /&gt;
&lt;br /&gt;
;; Results:&lt;br /&gt;
;; Arity Before &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;After&lt;br /&gt;
;; 0 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;611.455589 ns &amp;nbsp;607.800747 ns &amp;nbsp;&amp;nbsp;&amp;nbsp;(no change was expected)&lt;br /&gt;
;; 1 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3.098828 µs &amp;nbsp;&amp;nbsp;&amp;nbsp;611.116510 ns &amp;nbsp;&amp;nbsp;&amp;nbsp;(~5x improvement)&lt;br /&gt;
;; 2 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3.508726 µs &amp;nbsp;&amp;nbsp;&amp;nbsp;620.415032 ns &amp;nbsp;&amp;nbsp;&amp;nbsp;(~5x improvement)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Patch:* 0001-CLJ-2228-Improve-performance-of-constantly.patch&lt;br /&gt;
&lt;br /&gt;
*Prescreened by:* Alex Miller</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/1894/unroll-constantly-to-improve-performance-multi-arity-calls?show=1894#q1894</guid>
<pubDate>Tue, 07 Apr 2026 21:25:53 +0000</pubDate>
</item>
<item>
<title>Answered: Optimize `eduction`</title>
<link>https://ask.clojure.org/index.php/15027/optimize-eduction?show=15033#a15033</link>
<description>&lt;p&gt;Logged as &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2953&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2953&lt;/a&gt;&lt;/p&gt;
</description>
<category>Transducers</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15027/optimize-eduction?show=15033#a15033</guid>
<pubDate>Sun, 05 Apr 2026 21:50:04 +0000</pubDate>
</item>
<item>
<title>Answered: &quot;Nested&quot; vs &quot;lateral&quot; exception causes</title>
<link>https://ask.clojure.org/index.php/15031/nested-vs-lateral-exception-causes?show=15032#a15032</link>
<description>&lt;p&gt;I'm not sure this problem is common enough to warrant solving in core or extending the existing ex-info. If you are trying to throw a map bundling multiple exceptions, this really seems like a data problem more than an exception problem, and we have plenty of ways to bundle data into the ex map.&lt;/p&gt;
&lt;p&gt;In Java, the typical solution for (one) lateral exception is to use &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutionException.html&quot;&gt;ExecutionException&lt;/a&gt;, doesn't handle multiple though.&lt;/p&gt;
</description>
<category>Errors</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15031/nested-vs-lateral-exception-causes?show=15032#a15032</guid>
<pubDate>Sun, 05 Apr 2026 21:46:32 +0000</pubDate>
</item>
<item>
<title>Edited: Destructuring {:as opts} unexpected behaviour with seq</title>
<link>https://ask.clojure.org/index.php/15028/destructuring-as-opts-unexpected-behaviour-with-seq?show=15028#q15028</link>
<description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I found out something weird in some old code, where I wanted to pass the first map in a sequence and by mistake the code was working while actually passing the sequence itself!&lt;/p&gt;
&lt;p&gt;After digging to make sense of this, I found out it has to do with the &lt;code&gt;{:as opts}&lt;/code&gt; destructuring.&lt;/p&gt;
&lt;p&gt;Here's some code:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;;; even if something is assigned sequential vs associative
;; the `:as` is transparent
(let [[:as opts] {1 2 3 4}]
  opts)
#_=&amp;gt; {1 2, 3 4}
(let [{:as opts} [1 2 3 4]]
  opts)
#_=&amp;gt; [1 2 3 4]
;; however with a seq it's returned as a map
(let [{:as opts} (seq [1 2 3 4])]
  opts)
#_=&amp;gt; {1 2, 3 4}

;; and it only gets weirder!
(let [{:as opts} (seq [{:k :v}])]
  opts)
#_=&amp;gt; {:k :v}
(let [{:as opts} (seq [{:k1 :v1} {:k2 :v2}])]
  opts)
#_=&amp;gt; {{:k1 :v1} {:k2 :v2}}
(let [{:as opts} (seq [{:k1 :v1} {:k2 :v2} {:k3 :v3}])]
  opts)
#_=&amp;gt; {{:k1 :v1} {:k2 :v2}, :k3 :v3}
(let [{:as opts} (seq [{:k1 :v1} {:k2 :v2} :not-a-map])]
  opts)
;; java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Keyword
(let [{:as opts} (seq [1 2 3])]
  opts)
;; java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In my case I didn't realize my code was wrong because &lt;code&gt;{:as opts} {:k :v}&lt;/code&gt; is the same as &lt;code&gt;{:as opts} (seq [{:k :v}])&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;To me this is behaviour I would expect closer to &lt;code&gt;&amp;amp; {:as opts}&lt;/code&gt; rather than just plain map destructuring &lt;code&gt;{:as opts}&lt;/code&gt;. Maybe both behaviours should be separated?&lt;/p&gt;
&lt;p&gt;I think this should be tackled either by&lt;br&gt;
1. make &lt;code&gt;:as&lt;/code&gt; transparent regardless of what comes in to always bind&lt;br&gt;
2. throw an error earlier when it's not of the expected destructuring&lt;br&gt;
3. Document this very unexpected edge case in &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.org/reference/special_forms#associative-destructuring&quot;&gt;https://clojure.org/reference/special_forms#associative-destructuring&lt;/a&gt;&lt;br&gt;
4. Separate the keyword arguments use case from plain map destructuring? (Assuming both are now mixed together)&lt;/p&gt;
</description>
<category>Sequences</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15028/destructuring-as-opts-unexpected-behaviour-with-seq?show=15028#q15028</guid>
<pubDate>Sun, 05 Apr 2026 09:19:47 +0000</pubDate>
</item>
<item>
<title>Answered: requiring an empty .clj without an alias should fail as with an alias</title>
<link>https://ask.clojure.org/index.php/15022/requiring-an-empty-clj-without-alias-should-fail-with-alias?show=15023#a15023</link>
<description>&lt;p&gt;Logged:&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2951&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2951&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And one for compile:&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2952&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2952&lt;/a&gt;&lt;/p&gt;
</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15022/requiring-an-empty-clj-without-alias-should-fail-with-alias?show=15023#a15023</guid>
<pubDate>Thu, 02 Apr 2026 20:41:10 +0000</pubDate>
</item>
<item>
<title>Answered: Is taggedliteral's equality check inefficient?</title>
<link>https://ask.clojure.org/index.php/15002/is-taggedliterals-equality-check-inefficient?show=15020#a15020</link>
<description>&lt;p&gt;Logged as &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2950&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2950&lt;/a&gt;&lt;/p&gt;
</description>
<category>Records and Types</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15002/is-taggedliterals-equality-check-inefficient?show=15020#a15020</guid>
<pubDate>Tue, 31 Mar 2026 19:58:35 +0000</pubDate>
</item>
<item>
<title>Closed: Controlled Bailout, Jira issue 2213</title>
<link>https://ask.clojure.org/index.php/14999/controlled-bailout-jira-issue-2213?show=14999#q14999</link>
<description>&lt;p&gt;I would like to improve &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2213&quot;&gt;Issue 2213&lt;/a&gt; as follows. Do you think, this makes sense? Shall I become contributor for this? &lt;/p&gt;
&lt;p&gt;The new description would be:&lt;/p&gt;
&lt;p&gt;When developing Input-Process-Output tools I am often in the situation, that I have a sequence of activities (e.g. opening a file, spec checking a file, calling external tools, creating files), which each could fail in certain ways. Clojure does not have a good way to control such a sequence of activities in a way that all sorts of things, which could go wrong, can be handled comfortably. In imperative programming languages concepts like early exit or bailout are used. These are not not very functional. Unfortunately practical problems are often like this.&lt;/p&gt;
&lt;p&gt;The issue is a bit more general and a solution would be nice not only for those who develop such sort of tools. So I can give a simple example.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(let [config-file (get-file-from-network xy)
      config-file (parse-edn config-file)
      syntax-ok?   (spec-check config-file)]
  (do-something-with config-file))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As all these steps can fail, we could instead implement it like this.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(if-let [config-file (get-file-from-network xy)]
  (if-let [config-file (parse-edn config-file)]
    (if (spec-check config-file)
      (do-something-with config-file))))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now the code has suffered already a lot. The sequential nature of the problem is lost. And it is not even doing what we need. We have to report to the user what went wrong.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(if-let [config-file (get-file-from-network xy)]
  (if-let [config-file (parse-edn config-file)]
    (if (spec-check config-file)
      (do-something-with config-file)
      :file-has-syntax-errors)
    :file-not-valid-edn)
  :file-cannot be openned)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But this is still not doing what we need. We have to provide more information about each failure. If a file cannot be openned, is it because the file does not exist or we do not have read permissions? And what did the spec check tell us? So we cannot just use &lt;code&gt;nil&lt;/code&gt; as a universal failure. We must deliver more information when failing. And we cannot use if-let, either. So we are not even done.&lt;/p&gt;
&lt;p&gt;This problem report asks for a better solution for this conceptual challenge.&lt;/p&gt;
&lt;p&gt;This example depicts a conflict that should not happen when using an appropriate programming language: First we are able to quickly make a prototype. But in the end the final code has not much in common with the first code any more. The final design is not driven by the problem domain, but by the technical need for an error handling. The need for a bailout mechanism in this example imposes too many huge code changes.&lt;/p&gt;
&lt;p&gt;The principal problem with all these solutions is that they coerce a sequence of actions into something which is not a sequence. If your problem is a sequence, then the implementation should also be a sequence.&lt;/p&gt;
&lt;h2&gt;Idea: Exceptions&lt;/h2&gt;
&lt;p&gt;As an alternative implementation I went with Exceptions. But it feels wrong, because I am talking about things, that are expected to fail. I cannot just use the Exceptions that are comming out of Java for example when opening a file for read. I need detailed information, what went wrong. If you are a command line tool, it is expected from you, that you provide good error messages. I ended up catching and rethrowing exceptions everywhere in the program.&lt;/p&gt;
&lt;h2&gt;Idea: Like for/doseq&lt;/h2&gt;
&lt;p&gt;For me I created a small macro, that extends &lt;code&gt;let&lt;/code&gt;. Then I use this syntax:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(let [[config-file error] (get-file-from-network xy)
      :escape     error
      config-file (parse-edn config-file)
      syntax-ok?   (spec-check config-file)]
  (do-something-with config-file))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This often allows a surprisingly intuitive code. For example here:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(let [[config-file error-code] (get-file-from-network xy)
      :escape     (if (= error-code :does-not-exist) 
                    :file-xy-does-not-exist)
      :escape     (if (= error-code :io-error)
                    :file-xy-cannot-be-read)
      [config-file error-code] (parse-edn config-file)
      :escape     (if error-code :file-xy-not-legal-edn)
      syntax-ok?   (spec-check config-file)]
  (do-something-with config-file))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is inspired by the &lt;code&gt;for&lt;/code&gt;/&lt;code&gt;doseq&lt;/code&gt;. But I don't claim that this is a good solution for Clojure (although I think so). But I think, the &lt;code&gt;let&lt;/code&gt; macro is a good candidate when improving how Clojure can be used for such imperative things.&lt;/p&gt;
&lt;h2&gt;Idea: Using &lt;code&gt;if-let&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;I also investigated the solution, that was originally proposed by this issue.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(if-let [config-file (get-file-from-network xy)
         config-file (parse-edn config-file)
         config-file-ok? (spec-check config-file)]
  (do-something-with config-file)
  :error)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This problem with this solution is that none of the bindings are available in the else part. That makes it very hard to react accordingly. This is a nice and small new language feature. But I don't think, that in practice it would be of help so often. The example from the original issue was very artificial with mathematical operations that cannot fail. The first draft of this issue with that artificial example does not actally describe a real problem. That is why this issue has completelly been rewritten.&lt;/p&gt;
&lt;p&gt;Or course we could still bind everything, which was not failed. But I don't think, we would want that. It would have very interesting consequences to the compiling model.&lt;/p&gt;
&lt;h2&gt;Idea: Threading macros&lt;/h2&gt;
&lt;p&gt;As this issue is a about a sequence of activities, a new type of threading macro (e.g. &lt;code&gt;let-&amp;gt;&lt;/code&gt;) could also be an intuitive solution. But I have not tried anything like this.&lt;/p&gt;
&lt;h2&gt;Final Words&lt;/h2&gt;
&lt;p&gt;The principle challenge is, that all these solutions establish a sort of alternative control flow. It is a hard challenge to do this right, especially in a functional language. Like exceptions, that immediatelly exit and magically jump somewhere else. Clojure as a practically language could address this challenge.&lt;/p&gt;
</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14999/controlled-bailout-jira-issue-2213?show=14999#q14999</guid>
<pubDate>Tue, 31 Mar 2026 19:54:30 +0000</pubDate>
</item>
<item>
<title>Answered: Optimized str function</title>
<link>https://ask.clojure.org/index.php/14990/optimized-str-function?show=15003#a15003</link>
<description>&lt;p&gt;I've done some &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/bsless/prrr&quot;&gt;independent exploration&lt;/a&gt; of the options space for optimizing &lt;code&gt;str&lt;/code&gt; which does not involve anything ground shattering but still gives good performance improvements&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;variadic arities (up to 20, yuck) will probably give the best performance. Can settle for common cases like up to 5  (apply str will still suck but whatever)&lt;/li&gt;
&lt;li&gt;using reduce instead of a loop (would probably require redefining str or providing a str1 with the old impl for bootstrap purposes)&lt;/li&gt;
&lt;li&gt;using inline meta, orthogonal to all other options&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Additionally, having a function like &lt;code&gt;str&lt;/code&gt; which only takes a sequence and reduces over it could provide a better code path than (apply str xs)&lt;/p&gt;
&lt;p&gt;Similar work has been done in &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/joinr/spork/blob/master/src/spork/util/general.clj#L835&quot;&gt;spork&lt;/a&gt; and &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/kumarshantanu/stringer&quot;&gt;stringer&lt;/a&gt;&lt;/p&gt;
</description>
<category>Sequences</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14990/optimized-str-function?show=15003#a15003</guid>
<pubDate>Sun, 29 Mar 2026 08:47:19 +0000</pubDate>
</item>
<item>
<title>Closed: Why doesn't defn also implicitly name the anonymous function it defines for recursion?</title>
<link>https://ask.clojure.org/index.php/15000/doesnt-defn-implicitly-anonymous-function-defines-recursion?show=15000#q15000</link>
<description>&lt;p&gt;Why doesn't &lt;code&gt;defn&lt;/code&gt; implicitly name the function to create a named recursion point?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(clojure.walk/macroexpand-all
  '(defn foo [x]
     (foo x)))
; =&amp;gt;
(def foo
  (fn*
    ([x]
     (foo x))))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This could instead expand to&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(def foo
  (fn* foo ; note the foo here
    ([x]
     (foo x))))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;How it works right now, &lt;code&gt;foo&lt;/code&gt; resolves to a global var &lt;code&gt;#'foo&lt;/code&gt;, which is created when the &lt;code&gt;(def ...)&lt;/code&gt; form is analyzed. In the second case, it resolves directly to the function object. Thus, it should save us a var dereference at runtime in this case.&lt;/p&gt;
&lt;p&gt;EDIT: Found out, this is exactly what &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.org/reference/compilation#directlinking&quot;&gt;direct linking&lt;/a&gt; is used for.&lt;/p&gt;
</description>
<category>Macros</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15000/doesnt-defn-implicitly-anonymous-function-defines-recursion?show=15000#q15000</guid>
<pubDate>Thu, 26 Mar 2026 17:24:24 +0000</pubDate>
</item>
<item>
<title>Edited: Evaluating forms using eval can create a valid undesirable recursion point</title>
<link>https://ask.clojure.org/index.php/14991/evaluating-forms-using-create-valid-undesirable-recursion?show=14991#q14991</link>
<description>&lt;p&gt;When the &lt;code&gt;eval&lt;/code&gt; function in Clojure is called with an argument that is an instance of &lt;code&gt;IPersistentCollection&lt;/code&gt; which likely isn't a special def-like form (the first element isn't a symbol at all or it does not start with &lt;code&gt;&quot;def&quot;&lt;/code&gt;), the form is first wrapped in an anonymous function which then gets compiled and invoked, which indirectly evaluates the original form.&lt;/p&gt;
&lt;p&gt;There aren't any extra checks performed and it makes forms like these 2 valid, which should normally be rejected and a compiler exception should be thrown:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(recur)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(let []
  (print &quot;Hello&quot;)
  (Thread/sleep 1000)
  (recur))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;where the 2nd form keeps printing &quot;Hello&quot; and loops infinitely over the outer wrapper function.&lt;/p&gt;
</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14991/evaluating-forms-using-create-valid-undesirable-recursion?show=14991#q14991</guid>
<pubDate>Thu, 26 Mar 2026 04:05:02 +0000</pubDate>
</item>
<item>
<title>Answer selected: It's difficult to figure out options I can pass to slurp function.</title>
<link>https://ask.clojure.org/index.php/14975/its-difficult-to-figure-out-options-can-pass-slurp-function?show=14976#a14976</link>
<description>&lt;p&gt;This is fair. I created &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2944&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2944&lt;/a&gt; to track this.&lt;/p&gt;
</description>
<category>Docs</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14975/its-difficult-to-figure-out-options-can-pass-slurp-function?show=14976#a14976</guid>
<pubDate>Sat, 28 Feb 2026 06:27:25 +0000</pubDate>
</item>
<item>
<title>Answer selected: Is it legal for a namespace to start with a number?</title>
<link>https://ask.clojure.org/index.php/14962/is-it-legal-for-a-namespace-to-start-with-a-number?show=14963#a14963</link>
<description>&lt;p&gt;As far as I can tell, there is no reason a namespace segment other than the first can't start with a number.&lt;/p&gt;
</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14962/is-it-legal-for-a-namespace-to-start-with-a-number?show=14963#a14963</guid>
<pubDate>Mon, 23 Feb 2026 19:13:52 +0000</pubDate>
</item>
<item>
<title>Comment edited: CVE-warning in org.fressian/fressian &lt;- org.clojure/data.fressian</title>
<link>https://ask.clojure.org/index.php/14872/cve-warning-org-fressian-fressian-org-clojure-data-fressian?show=14937#c14937</link>
<description>Package URI looks right.&lt;br /&gt;
&lt;br /&gt;
For CPE, you'll have to put `unknown`. I used the CPE search on the NVD site and could not find any CPEs for `fressian`, nor does the 2018 CVE data feed contain `fressian`.&lt;br /&gt;
&lt;br /&gt;
ODC Integration: CLI is the closest option. &lt;br /&gt;
&lt;br /&gt;
ODC Version: &lt;a href=&quot;https://github.com/clj-holmes/clj-watson/blob/main/deps.edn#L10&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://github.com/clj-holmes/clj-watson/blob/main/deps.edn#L10&lt;/a&gt; so it's current 12.1.6 unless you're overriding it locally.</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14872/cve-warning-org-fressian-fressian-org-clojure-data-fressian?show=14937#c14937</guid>
<pubDate>Fri, 20 Feb 2026 02:51:41 +0000</pubDate>
</item>
</channel>
</rss>