<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Recent questions and answers in Compiler</title>
<link>https://ask.clojure.org/index.php/qa/clojure/compiler</link>
<description></description>
<item>
<title>Answered: 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=15156#a15156</link>
<description>&lt;p&gt;It might be useful for the compiler to give a warning when a var is redefined such that it loses a primitive interface.&lt;/p&gt;
&lt;p&gt;We could still detect these changes without compiler changes like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Clojure 1.12.5
user=&amp;gt; (defn f ^long [^long a] a)
#'user/f
user=&amp;gt; (add-watch #'f ::undo-prim (fn [_ _ old new] (when (and (instance? clojure.lang.IFn$LL old) (not (instance? clojure.lang.IFn$LL new))) (println &quot;WARNING: removed clojure.lang.IFn$LL from f&quot;))))
#'user/f
user=&amp;gt; (defn f [a] a)
WARNING: removed clojure.lang.IFn$LL from f
#'user/f
&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=15156#a15156</guid>
<pubDate>Fri, 03 Jul 2026 00:06:18 +0000</pubDate>
</item>
<item>
<title>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</link>
<description>&lt;p&gt;As of Clojure 1.13.0-alpha2, &lt;code&gt;(.method ClassName)&lt;/code&gt; expands to &lt;code&gt;(.method ^Class (identity ClassName))&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This is to force &lt;code&gt;(.method ClassName)&lt;/code&gt; to always be an instance method. Without this, it would expand to &lt;code&gt;(. ClassName method)&lt;/code&gt;, which may instead be interpreted as a static method.&lt;/p&gt;
&lt;p&gt;For example, &lt;code&gt;(.getMethods String)&lt;/code&gt; expands to &lt;code&gt;(.getMethods ^Class (identity String))&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This was introduced in these two commits:&lt;br&gt;
- &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/clojure/commit/f95175264df36c3d8fe2113aa9af92cda0f2f5c8&quot;&gt;force instance member interpretation of (.method ClassName), e.g. (.getMethods String) works&lt;/a&gt;&lt;br&gt;
- &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/clojure/commit/e45046da8f7fef82157b58af54d1ac6de8e31160&quot;&gt;added autohinting to Class in macroexpansion of (.instanceMethodOfClass Classname) calls&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Since then, Clojure has added support for qualified methods which we can use to reliably propagate the tag without any runtime changes. For example, expanding to &lt;code&gt;(Class/.getMethods String)&lt;/code&gt; is now equivalent to &lt;code&gt;(.getMethods ^Class (identity String))&lt;/code&gt; in terms of tag propagation.&lt;/p&gt;
&lt;p&gt;I have a proof-of-concept &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/frenchy64/clojure/pull/52/changes&quot;&gt;here&lt;/a&gt; that includes disassembled and decompiled output before and after the change. The net effect of using qualified methods in this case under direct linking is a removal of a single method call to &lt;code&gt;identity&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;   3: invokestatic  #20                 // Method clojure/core$identity.invokeStatic:(Ljava/lang/Object;)Ljava/lang/Object;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The effect is more substantial without direct linking (not included in the PR), with &lt;code&gt;clojure.core/identity&lt;/code&gt; also being added to the static initializer.&lt;/p&gt;
&lt;p&gt;I've also experimented with expanding to &lt;code&gt;(. (do String) getMethods)&lt;/code&gt; (see earlier commits in that PR), which seems to also work and might be another approach.&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15155/possibly-avoidable-identity-force-instance-method-literals</guid>
<pubDate>Thu, 02 Jul 2026 23:47:10 +0000</pubDate>
</item>
<item>
<title>Feature Request:Make anonymous fn/reify class name IDs per namespace instead of one global counter</title>
<link>https://ask.clojure.org/index.php/14935/feature-request-anonymous-namespace-instead-global-counter</link>
<description>&lt;p&gt;  Compiled anonymous functions and reify classes get names like ns$fn__4532, where the numeric suffix comes from a global AtomicInteger counter&lt;br&gt;
  (RT.nextID()).&lt;/p&gt;
&lt;p&gt; This counter is shared across the entire runtime and is consumed by fn classes, reify classes, constants tables, gensyms, etc.&lt;/p&gt;
&lt;p&gt;  The problem is that because the counter is global, any code change shifts the IDs for everything compiled after it. This makes profiling across builds&lt;br&gt;
  really painful, you can't meaningfully compare flame graphs because all the class names change even in code you didn't touch.&lt;/p&gt;
&lt;p&gt;  I'd like to propose scoping the ID counter per-namespace instead. Since the namespace is already part of the class name prefix, uniqueness is still&lt;br&gt;
  guaranteed. This would eliminate the cascading effect across unchanged namespaces and make profiling diffs actually useful.&lt;/p&gt;
&lt;p&gt;I'm not sure what's the downsides of this, but from what I saw of AtomicInteger, it isn't used a lot to break things.&lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14935/feature-request-anonymous-namespace-instead-global-counter</guid>
<pubDate>Wed, 18 Feb 2026 15:34:38 +0000</pubDate>
</item>
<item>
<title>Answered: bit-count in cljs but not clj</title>
<link>https://ask.clojure.org/index.php/14917/bit-count-in-cljs-but-not-clj?show=14918#a14918</link>
<description>&lt;p&gt;Logged as &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2937&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2937&lt;/a&gt;&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14917/bit-count-in-cljs-but-not-clj?show=14918#a14918</guid>
<pubDate>Fri, 30 Jan 2026 14:20:06 +0000</pubDate>
</item>
<item>
<title>Answered: Why is `list` defined with a RestFn instead of `create` method?</title>
<link>https://ask.clojure.org/index.php/14820/why-is-list-defined-with-a-restfn-instead-of-create-method?show=14823#a14823</link>
<description>&lt;p&gt;Probably only known to Rich, don't think these inconsistencies are important.&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14820/why-is-list-defined-with-a-restfn-instead-of-create-method?show=14823#a14823</guid>
<pubDate>Tue, 09 Dec 2025 22:44:08 +0000</pubDate>
</item>
<item>
<title>Answered: cannot call Java Constructor overload</title>
<link>https://ask.clojure.org/index.php/14744/cannot-call-java-constructor-overload?show=14745#a14745</link>
<description>&lt;p&gt;That constructor is private, you can't call it.&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14744/cannot-call-java-constructor-overload?show=14745#a14745</guid>
<pubDate>Mon, 03 Nov 2025 18:35:22 +0000</pubDate>
</item>
<item>
<title>Answered: Macro expansion lose type hints</title>
<link>https://ask.clojure.org/index.php/14740/macro-expansion-lose-type-hints?show=14741#a14741</link>
<description>&lt;p&gt;I believe this is the same general problem as &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-865&quot;&gt;https://clojure.atlassian.net/browse/CLJ-865&lt;/a&gt;, which has been long-debated in the core team.&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14740/macro-expansion-lose-type-hints?show=14741#a14741</guid>
<pubDate>Mon, 03 Nov 2025 14:30:41 +0000</pubDate>
</item>
<item>
<title>Unwrapped do is treated as a special form in let and fn bodies</title>
<link>https://ask.clojure.org/index.php/14729/unwrapped-do-is-treated-as-a-special-form-in-let-and-fn-bodies</link>
<description>&lt;p&gt;when a let or fn body begins with the bare symbol &lt;code&gt;do&lt;/code&gt; (not in list head position) it is treated as a do-block wrapper for the rest of the body&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Clojure 1.12.0
user=&amp;gt; (let [] do)
nil
user=&amp;gt; (let [] do 123)
123
user=&amp;gt; (let [] 123 do)
Syntax error compiling at (REPL:1:1).
Unable to resolve symbol: do in this context
user=&amp;gt; ((fn [] do))
nil
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Aside from being unexpected, it also has the effect of appearing to override any local binding named 'do':&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;user=&amp;gt; (let [do :something] do)
nil
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note that Clojurescript treats all the above cases 'correctly':&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ClojureScript 1.11.132
cljs.user=&amp;gt; (let [] do)
                    ^
WARNING: Use of undeclared Var cljs.user/do at line 1
nil
cljs.user=&amp;gt; (let [do :something] do)
:something
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The community guide at &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure-doc.org/articles/language/macros/&quot;&gt;https://clojure-doc.org/articles/language/macros/&lt;/a&gt;&lt;br&gt;
has pointed out this exact edge case (since 2013?) and recommends to 'Never use special names as local binding or global variable names'. However it seems like a bug worth addressing given the discrepancy between JVM/CLJS outputs&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14729/unwrapped-do-is-treated-as-a-special-form-in-let-and-fn-bodies</guid>
<pubDate>Fri, 24 Oct 2025 17:30:35 +0000</pubDate>
</item>
<item>
<title>Compiler-generated `foo__init.class` files lack `SourceFile` attribute</title>
<link>https://ask.clojure.org/index.php/14652/compiler-generated-fooinit-class-sourcefile-attribute</link>
<description>&lt;p&gt;Most .class files generated by Clojure contain the expected &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.oracle.com/javase/specs/jvms/se11/html/jvms-4.html#jvms-4.7.10&quot;&gt;SourceFile&lt;/a&gt; attribute (you can verify with &lt;code&gt;javap -v&lt;/code&gt;). But &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.org/reference/compilation#_compiling&quot;&gt;__init&lt;/a&gt; classfiles lack this metadata. I asked @alexmiller on Slack, and he suggested I bring it up here.&lt;/p&gt;
&lt;p&gt;The same appears to be true of classes generated via &lt;code&gt;proxy&lt;/code&gt;.&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14652/compiler-generated-fooinit-class-sourcefile-attribute</guid>
<pubDate>Thu, 31 Jul 2025 22:21:18 +0000</pubDate>
</item>
<item>
<title>Answered: Using letfn* for defining corecursive reified implementations</title>
<link>https://ask.clojure.org/index.php/14592/using-letfn-defining-corecursive-reified-implementations?show=14638#a14638</link>
<description>&lt;p&gt;&lt;code&gt;letfn*&lt;/code&gt; and &lt;code&gt;reify*&lt;/code&gt; are low-level undocumented implementation parts of &lt;code&gt;letfn&lt;/code&gt; and &lt;code&gt;reify&lt;/code&gt;. One of &lt;code&gt;letfn&lt;/code&gt;'s features (by design) is to support corecursive implementations ala:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defn is-even? [n]
  (letfn [(neven? [n] (if (zero? n) true (nodd? (dec n))))
          (nodd? [n] (if (zero? n) false (neven? (dec n))))]
    (neven? n)))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I'm not really sure what your actual intent is but I would try to use letfn first (and not reify IFn at all).&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14592/using-letfn-defining-corecursive-reified-implementations?show=14638#a14638</guid>
<pubDate>Fri, 18 Jul 2025 19:28:59 +0000</pubDate>
</item>
<item>
<title>Answered: Consider documenting usage of `do` for the Gilardi scenario</title>
<link>https://ask.clojure.org/index.php/14628/consider-documenting-usage-of-do-for-the-gilardi-scenario?show=14636#a14636</link>
<description>&lt;p&gt;Logged as &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/clojure-site/issues/723&quot;&gt;https://github.com/clojure/clojure-site/issues/723&lt;/a&gt;&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14628/consider-documenting-usage-of-do-for-the-gilardi-scenario?show=14636#a14636</guid>
<pubDate>Fri, 18 Jul 2025 19:14:01 +0000</pubDate>
</item>
<item>
<title>Answered: Is the ant build broken in Clojure 1.12.1?</title>
<link>https://ask.clojure.org/index.php/14567/is-the-ant-build-broken-in-clojure-1-12-1?show=14568#a14568</link>
<description>&lt;p&gt;Hey Steve, the official build for Clojure is the Maven build (it does actually call out to the ant build for parts of its work but it uses the maven classpaths when doing so). To run the Clojure tests you should do &lt;code&gt;mvn clean test&lt;/code&gt; and to package you can do &lt;code&gt;mvn clean package&lt;/code&gt; (or &lt;code&gt;install&lt;/code&gt; to make a local version). &lt;/p&gt;
&lt;p&gt;The Ant build is as I mentioned still wrapped for some parts of the Maven build (some day maybe that will eventually get cleaned up).&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14567/is-the-ant-build-broken-in-clojure-1-12-1?show=14568#a14568</guid>
<pubDate>Tue, 03 Jun 2025 16:45:07 +0000</pubDate>
</item>
<item>
<title>Can custom literal collections reach parity with clojure's built in collections?</title>
<link>https://ask.clojure.org/index.php/14474/custom-literal-collections-reach-parity-clojures-collections</link>
<description>&lt;h3&gt;Teaching Old &lt;code&gt;eval&lt;/code&gt; New Tricks&lt;/h3&gt;
&lt;h4&gt;Tagged Literals Promise Extensibility&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;EDN and Tagged Literals:&lt;/strong&gt;&lt;br&gt;
- In EDN, tagged literals deliver complete extensibility.&lt;br&gt;
- When processing EDN data, custom types created with tagged readers achieve parity with built-in literals.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Clojure’s Syntax and Tagged Literals:&lt;/strong&gt;&lt;br&gt;
- Clojure's syntax, as a superset of EDN, includes tagged literals.&lt;br&gt;
- &lt;strong&gt;Key Differences:&lt;/strong&gt;&lt;br&gt;
  - EDN is for reading data, while Clojure's syntax is expected to be eval'ed.&lt;br&gt;
  - Tagged literals in Clojure code are treated as second-class citizens compared to built-in types because:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;1. The compiler inherently knows how to compile built-in types,
   but it does not understand other types returned by tagged
   readers.
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Compiler Behavior and Challenges:&lt;/strong&gt;&lt;br&gt;
- By default:&lt;br&gt;
  - The compiler embeds the instance as a string in the emitted bytecode, recreating the instance at runtime via the reader.&lt;br&gt;
- &lt;strong&gt;Issues with Collections:&lt;/strong&gt;&lt;br&gt;
  - Container types like third party collections are problematic because their interior data is not evaluated.&lt;br&gt;
  - Common advice suggests returning a form that, when evaluated, creates an instance of the type. However:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;- This makes the result no longer a literal, as:
  - The reader does not produce the expected type.
  - Macros don't see the expected type
  - You only get the expected type after eval.
- For mixed environments (EDN without eval vs. Clojure with
  eval), separate tagged readers for the same tag may be
  required.
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Towards a Solution&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Compiler Extensions:&lt;/strong&gt;&lt;br&gt;
- A potential solution involves creating an extension point to teach the compiler how to compile new types.&lt;br&gt;
- Special care is required for cross-compiling dialects, such as ClojureScript.&lt;br&gt;
  - JVM collections might need to self-compile for ClojureScript.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Backward Compatibility:&lt;/strong&gt;&lt;br&gt;
- Ideally, any solution would:&lt;br&gt;
  - Retain the existing &quot;self-quoting&quot; behavior.&lt;br&gt;
  - Allow types to opt into new functionality.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14474/custom-literal-collections-reach-parity-clojures-collections</guid>
<pubDate>Thu, 20 Mar 2025 21:46:42 +0000</pubDate>
</item>
<item>
<title>Answered: Breaking change in 1.12.0 - a static field is always preferred to a static function with the same name</title>
<link>https://ask.clojure.org/index.php/14435/breaking-change-static-field-always-preferred-static-function?show=14440#a14440</link>
<description>&lt;p&gt;Created &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2899&quot;&gt;CLJ-2899&lt;/a&gt;.&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14435/breaking-change-static-field-always-preferred-static-function?show=14440#a14440</guid>
<pubDate>Tue, 04 Mar 2025 13:37:44 +0000</pubDate>
</item>
<item>
<title>Answered: Comparing ratios with BigDecimals can throw</title>
<link>https://ask.clojure.org/index.php/14411/comparing-ratios-with-bigdecimals-can-throw?show=14413#a14413</link>
<description>&lt;p&gt;Separating these a little bit:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;=&lt;/code&gt; will return false if two numbers are compared across different numeric partitions (int+ratio+bigint, float, bigdec). This one is kind of special. You say &quot;= works&quot; above but I don't think it works presumably meaning it does not throw, but it will always return &lt;code&gt;false&lt;/code&gt; for cross-partition, e.g. &lt;code&gt;(= 1/2 0.5M)&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Other numeric comparison operators coerce args to matching type, then compare. This includes &lt;code&gt;==&lt;/code&gt; which thus does &lt;code&gt;=&lt;/code&gt; across partitions. There are some cases where the coercion cannot occur - I think maybe irrational fraction to bigdecimal is the obvious (only?) case and in that case there is available coercion. &lt;/p&gt;
&lt;p&gt;I consider this expected behavior, not sure where we could document it but open to ideas. Maybe &lt;code&gt;bigdec&lt;/code&gt; docstring, or at &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.org/reference/data_structures#Numbers&quot;&gt;https://clojure.org/reference/data_structures#Numbers&lt;/a&gt; ? Where did you look first?&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14411/comparing-ratios-with-bigdecimals-can-throw?show=14413#a14413</guid>
<pubDate>Fri, 21 Feb 2025 21:27:28 +0000</pubDate>
</item>
<item>
<title>Incorrect result when evaluating `not=` on `##NaNs`</title>
<link>https://ask.clojure.org/index.php/14298/incorrect-result-when-evaluating-not-on-nans</link>
<description>&lt;p&gt;Alex Miller asked me to write this up here. I found a bug in clojure.core yesterday that involves &lt;code&gt;not=&lt;/code&gt; when used to compare NaNs. This was reported on Slack and the discussion is here:&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://clojurians.slack.com/archives/C03S1KBA2/p1733612992809069&quot;&gt;https://clojurians.slack.com/archives/C03S1KBA2/p1733612992809069&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here is a more highly summarized version of the discussion from Slack (at least from my perspective). If we fire up the Clojure CLI, we can evaluate the following.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; Clojure 1.12.0
 user=&amp;gt; (= ##NaN ##NaN)
 false
 user=&amp;gt; (not= ##NaN ##NaN)
 false
 user=&amp;gt; (not (= ##NaN ##NaN))
 true
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The problem here is that &lt;code&gt;=&lt;/code&gt;, &lt;code&gt;not&lt;/code&gt;, and &lt;code&gt;not=&lt;/code&gt; have a relationship between them. Specifically, for any &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt;, if &lt;code&gt;(= x y)&lt;/code&gt; returns a boolean, then &lt;code&gt;(not (= x y))&lt;/code&gt; should return the opposite boolean, and since &lt;code&gt;not=&lt;/code&gt; is defined as &lt;code&gt;(not (= x y))&lt;/code&gt;, it should return the same value as &lt;code&gt;(not (= x y))&lt;/code&gt; for all &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt;. This doesn't happen if &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt; are both &lt;code&gt;##NaN&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Note that there were a lot of calories burned on Slack with suggestions that doubles should never be compared for equality, that NaNs are shifty, not-quite-value objects and should be avoided, that anybody who wants to test for the presence of a NaN should use &lt;code&gt;NaN?&lt;/code&gt; which is already in clojure.core, and that the documentation around equality should be updated to say some of those things. Many of those statements are true or good practice. But all of them miss the broader point.&lt;/p&gt;
&lt;p&gt;This bug has nothing to do specifically to do with NaNs. It just seems that NaNs expose the bug. The real issue is with the contractual relationship between &lt;code&gt;=&lt;/code&gt;, &lt;code&gt;not&lt;/code&gt;, and &lt;code&gt;not=&lt;/code&gt; which appears to be violated in the presence of NaNs. Specifically, &lt;code&gt;not=&lt;/code&gt; is no longer referentially transparent with respect to &lt;code&gt;(not (= ...))&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;On Slack, @potetm decompiled the code generated for these cases and found the following.&lt;/p&gt;
&lt;p&gt;For &lt;code&gt;(not= ##NaN ##NaN)&lt;/code&gt; :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(clj-java-decompiler.core/decompile
  (not= ##NaN ##NaN))

// Decompiling class: cjd__init
import clojure.lang.*;

public class cjd__init
{
    public static final Var __not_EQ_;
    public static final Object const__1;
    
    public static void load() {
        ((IFn)cjd__init.__not_EQ_.getRawRoot()).invoke(cjd__init.const__1, cjd__init.const__1);
    }
    
    public static void __init0() {
        __not_EQ_ = RT.var(&quot;clojure.core&quot;, &quot;not=&quot;);
        const__1 = Double.NaN;
    }
    
    static {
        __init0();
        Compiler.pushNSandLoader(RT.classForName(&quot;cjd__init&quot;).getClassLoader());
        try {
            load();
            Var.popThreadBindings();
        }
        finally {
            Var.popThreadBindings();
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And then for &lt;code&gt;(not (= ##NaN ##NaN))&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(clj-java-decompiler.core/decompile
  (not (= ##NaN ##NaN)))

// Decompiling class: cjd__init
import clojure.lang.*;

public class cjd__init
{
    public static final Var __not;
    
    public static void load() {
        ((IFn)cjd__init.__not.getRawRoot()).invoke(Util.equiv(Double.NaN, Double.NaN) ? Boolean.TRUE : Boolean.FALSE);
    }
    
    public static void __init0() {
        __not = RT.var(&quot;clojure.core&quot;, &quot;not&quot;);
    }
    
    static {
        __init0();
        Compiler.pushNSandLoader(RT.classForName(&quot;cjd__init&quot;).getClassLoader());
        try {
            load();
            Var.popThreadBindings();
        }
        finally {
            Var.popThreadBindings();
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It appears that the compiler optimizes the call to &lt;code&gt;=&lt;/code&gt; and does not box the &lt;code&gt;##NaN&lt;/code&gt; values when compiling &lt;code&gt;(not (= ##NaN ##NaN))&lt;/code&gt;, whereas the call to &lt;code&gt;not=&lt;/code&gt; receives the &lt;code&gt;##NaN&lt;/code&gt;s boxed as Doubles. This then causes a subsequent call to &lt;code&gt;clojure.lang.Util/equiv&lt;/code&gt; (after following the call chain through &lt;code&gt;not=&lt;/code&gt; -&amp;gt; &lt;code&gt;=&lt;/code&gt; -&amp;gt; &lt;code&gt;clojure.lang.Util/equiv&lt;/code&gt;) to return &lt;code&gt;true&lt;/code&gt; improperly (since NaNs are never equal to anything, even themselves).&lt;/p&gt;
&lt;p&gt;IMO, this is a bug, albeit a low priority one. Most programmers successfully use floating point math without ever having to deal with NaNs. While NaNs seem to trigger the bug, there may be other cases that also trigger it. I can't speak to that.&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14298/incorrect-result-when-evaluating-not-on-nans</guid>
<pubDate>Sun, 08 Dec 2024 21:14:02 +0000</pubDate>
</item>
<item>
<title>Answered: Is there any possibility of a Clojure Android port?</title>
<link>https://ask.clojure.org/index.php/14236/is-there-any-possibility-of-a-clojure-android-port?show=14238#a14238</link>
<description>&lt;p&gt;What I mean is that it has compatibility with Android and Termux, and is on the repos (it currently isn't)&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14236/is-there-any-possibility-of-a-clojure-android-port?show=14238#a14238</guid>
<pubDate>Mon, 11 Nov 2024 15:14:59 +0000</pubDate>
</item>
<item>
<title>Answered: What are the system requirements for Clojure?</title>
<link>https://ask.clojure.org/index.php/14228/what-are-the-system-requirements-for-clojure?show=14230#a14230</link>
<description>&lt;p&gt;Clojure (the language) is distributed as a Java archive and runs on the JVM, thus you will need Java installed. If you don't have specific Java requirements, we recommend Java 21, the latest LTS release.&lt;/p&gt;
&lt;p&gt;The installation links are here for the Clojure CLI which can be used to manage dependencies, run a REPL, etc:&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.org/guides/install_clojure#_windows_instructions&quot;&gt;https://clojure.org/guides/install_clojure#_windows_instructions&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you are using WSL, then you'll want to follow the Linux instructions. If no WSL, use the clj-msi installer.&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14228/what-are-the-system-requirements-for-clojure?show=14230#a14230</guid>
<pubDate>Thu, 07 Nov 2024 19:29:28 +0000</pubDate>
</item>
<item>
<title>Answered: issue using new functional interface sugar with log4j</title>
<link>https://ask.clojure.org/index.php/14192/issue-using-new-functional-interface-sugar-with-log4j?show=14195#a14195</link>
<description>&lt;pre&gt;&lt;code&gt;(~/clojure)-(!2011)-&amp;gt; clj -Sdeps '{:deps {org.apache.logging.log4j/log4j-api {:mvn/version &quot;2.23.1&quot;}}}'
Clojure 1.12.0
user=&amp;gt; (.isAnnotationPresent org.apache.logging.log4j.util.MessageSupplier java.lang.FunctionalInterface)
false
user=&amp;gt;

(~/clojure)-(!2012)-&amp;gt; clj -Sdeps '{:deps {org.apache.logging.log4j/log4j-api {:mvn/version &quot;2.24.0&quot;}}}'
Clojure 1.12.0
user=&amp;gt; (.isAnnotationPresent org.apache.logging.log4j.util.MessageSupplier java.lang.FunctionalInterface)
true
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So, I would expect this to fail with 2.23.1 but work with 2.24.0.&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14192/issue-using-new-functional-interface-sugar-with-log4j?show=14195#a14195</guid>
<pubDate>Mon, 14 Oct 2024 22:58:43 +0000</pubDate>
</item>
<item>
<title>Answered: The new array class syntax in 1.12 doesn't seem to be supported by definterface meta tags</title>
<link>https://ask.clojure.org/index.php/14083/array-class-syntax-doesnt-seem-supported-definterface-meta?show=14084#a14084</link>
<description>&lt;p&gt;Thanks for helping post the question! &lt;/p&gt;
&lt;p&gt;For additional context, I noticed that &lt;code&gt;defprotocol&lt;/code&gt; generates a valid interface given the same metadata tags, because the generated methods are dynamically typed, with the tags only being placed as type hints in the protocol map.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;user=&amp;gt; (defprotocol PFoo (^String/1 bar [this]))
PFoo
user=&amp;gt; (reify user.PFoo (bar [this] :ok))
#object[user$eval196$reify__197 0x64a9d48c &quot;user$eval196$reify__197@64a9d48c&quot;]
user=&amp;gt; (bar *1)
:ok
user=&amp;gt; (first (.getMethods (:on-interface PFoo)))
#object[java.lang.reflect.Method 0x35178483 &quot;public abstract java.lang.Object user.PFoo.bar()&quot;]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Although the fact that it produces an unreadable symbol feels just as wrong:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;user=&amp;gt; (:sigs PFoo)
{:bar {:tag [Ljava.lang.String;, :name bar, :arglists ([this]), :doc nil}}
user=&amp;gt; (get-in PFoo [:sigs :bar :tag])
[Ljava.lang.String;
user=&amp;gt; (class *1) ; oh no
clojure.lang.Symbol
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14083/array-class-syntax-doesnt-seem-supported-definterface-meta?show=14084#a14084</guid>
<pubDate>Sat, 24 Aug 2024 20:14:53 +0000</pubDate>
</item>
<item>
<title>Answered: Inconsistencies between Clojure's new functional interface conversion and Java's</title>
<link>https://ask.clojure.org/index.php/13960/inconsistencies-clojures-functional-interface-conversion?show=13963#a13963</link>
<description>&lt;p&gt;1) Our goal here was to find places where Clojure functions have a semantic match to Java constructs and make their use in that place implicit. Functional interfaces marked as such must have a single method and have clearly stated that intent. SAM interfaces, while structurally similar, do not have that stated intent and may not be a semantic match to Clojure functions (instead being &quot;procedures&quot; or some non-functional idea).&lt;/p&gt;
&lt;p&gt;That said, the combination of SAMs and method values is an interesting convergence point that we are still working on. If you are passing a method value to a method taking a SAM, that is a point where we can directly adapt (as Java does with method references) without creating a method value wrapper and adapting that. That is a use where there is no Clojure function and no need for a semantic match and we may support that, still TBD.&lt;/p&gt;
&lt;p&gt;2) maybeFIMethod checks that the class has the @FunctionalInterface annotation, which can only exist on interfaces, and thus it is redundant to check if it is an interface.  &lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13960/inconsistencies-clojures-functional-interface-conversion?show=13963#a13963</guid>
<pubDate>Mon, 10 Jun 2024 13:24:23 +0000</pubDate>
</item>
<item>
<title>Answered: More customizable elide meta?</title>
<link>https://ask.clojure.org/index.php/13938/more-customizable-elide-meta?show=13941#a13941</link>
<description>&lt;p&gt;No, that level of customization is not available currently. Can you say more about what problem you're trying to solve?&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13938/more-customizable-elide-meta?show=13941#a13941</guid>
<pubDate>Sun, 02 Jun 2024 20:31:27 +0000</pubDate>
</item>
<item>
<title>Answered: Locals clearing + forcing a delay recursively results in NPE</title>
<link>https://ask.clojure.org/index.php/13930/locals-clearing-forcing-a-delay-recursively-results-in-npe?show=13931#a13931</link>
<description>&lt;p&gt;Seems like a bug to me. Logged as &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2861&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2861&lt;/a&gt;&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13930/locals-clearing-forcing-a-delay-recursively-results-in-npe?show=13931#a13931</guid>
<pubDate>Thu, 30 May 2024 21:26:20 +0000</pubDate>
</item>
<item>
<title>Answered: Why does running an uberjar reload namespaces?</title>
<link>https://ask.clojure.org/index.php/13839/why-does-running-an-uberjar-reload-namespaces?show=13840#a13840</link>
<description>&lt;p&gt;There's no double loading or reloading. Code compilation in Clojure actually runs that code (meaning, it runs all the top-level forms, it won't actually run your &lt;code&gt;-main&lt;/code&gt; function unless it's called at the top level). And running the code in an uberjar, well, also runs the code. It's a completely separate step, separate loading.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;what are the implications of this double loading?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The main one is that a namespace declaration should be free of side-effects and referentially transparent (barring implicitly changing the current namespace by all the &lt;code&gt;def&lt;/code&gt;s).&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;What if I had some very expensive computation in a def, and really wanted to pre-compute it once (and only once)?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If you don't want for the expensive computation to be run at compile time, you can use &lt;code&gt;delay&lt;/code&gt;.&lt;br&gt;
If you want to inline the results of a computation during compilation, you can use a macro.&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13839/why-does-running-an-uberjar-reload-namespaces?show=13840#a13840</guid>
<pubDate>Thu, 25 Apr 2024 19:21:38 +0000</pubDate>
</item>
<item>
<title>Answered: Compiler exception caused by dynamically created :arglists metadata + recursive call in defn body</title>
<link>https://ask.clojure.org/index.php/13834/compiler-exception-dynamically-arglists-metadata-recursive?show=13835#a13835</link>
<description>&lt;p&gt;Var arglists should be a literal list of vectors, like:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:arglists '([shape] [shape shape-attrs])
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13834/compiler-exception-dynamically-arglists-metadata-recursive?show=13835#a13835</guid>
<pubDate>Mon, 22 Apr 2024 17:28:03 +0000</pubDate>
</item>
<item>
<title>Cannot invoke &quot;clojure.lang.Var.isBound()&quot; because &quot;clojure.lang.Compiler.LOADER&quot; is null, potential bug?</title>
<link>https://ask.clojure.org/index.php/13819/cannot-clojure-isbound-because-clojure-compiler-potential</link>
<description>&lt;p&gt;As per &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojurians.slack.com/archives/C03S1KBA2/p1713446287942589&quot;&gt;discussion&lt;/a&gt; on slack I'm posting here the findings regarding clojure.lang.Compiler.LOADER being null during the analysis phase of GraalVM native-image run.&lt;/p&gt;
&lt;p&gt;The full reproduction can be found &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/FieryCod/graalvm-repro&quot;&gt;here&lt;/a&gt; and the link to issue on Oracle GraalVM side &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/oracle/graal/issues/8801&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What is this issue about?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Native Image cannot be produced and throws an error during analysis phase when Clojure 1.11.2 (although the previous version of Clojure might be also affected) is used and reflection entries for java.lang.UUID and clojure.lang.Keyword are present in &lt;code&gt;reflectionconfig.json&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;I can't however reproduce the error prior to Clojure 1.9.0. For more information please kindly take a look into a repro.&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13819/cannot-clojure-isbound-because-clojure-compiler-potential</guid>
<pubDate>Thu, 18 Apr 2024 16:11:35 +0000</pubDate>
</item>
<item>
<title>Answered: Why does compilation of fn fail when referencing a class with a failing static field initializer?</title>
<link>https://ask.clojure.org/index.php/13810/compilation-referencing-class-failing-static-initializer?show=13811#a13811</link>
<description>&lt;p&gt;Almost certainly the compiler is emitting a Class.forName() somewhere instead of the variation of that with initialize=false, causing the static initializer to run before its needed.&lt;/p&gt;
&lt;p&gt;Logged as &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2842&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2842&lt;/a&gt;&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13810/compilation-referencing-class-failing-static-initializer?show=13811#a13811</guid>
<pubDate>Mon, 08 Apr 2024 16:51:12 +0000</pubDate>
</item>
<item>
<title>Answered: Can direct-linking be enabled for my own code and not for libraries?</title>
<link>https://ask.clojure.org/index.php/13757/can-direct-linking-enabled-for-own-code-and-not-for-libraries?show=13759#a13759</link>
<description>&lt;blockquote&gt;&lt;p&gt;can break libraries&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;How so?&lt;/p&gt;
&lt;p&gt;What matters is what those compiler bindings are set to when compiling happens. Compiling happens during load, so it should be possible to be clever about this, but it would be clever. I think there is another ask question somewhere about giving more control around where to direct link.&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13757/can-direct-linking-enabled-for-own-code-and-not-for-libraries?show=13759#a13759</guid>
<pubDate>Tue, 27 Feb 2024 16:12:47 +0000</pubDate>
</item>
<item>
<title>Answered: In 1.12, use arity for method selection disambiguation where possible</title>
<link>https://ask.clojure.org/index.php/13684/use-arity-method-selection-disambiguation-where-possible?show=13694#a13694</link>
<description>&lt;p&gt;This is by design - in qualified constructor, instance method, and static method symbols in invocation or value position require you to specify exactly one method arity/overload via if param-tags. No inference is done, no reflection occurs, and you wll get a compiler exception if the method is ambiguous.&lt;/p&gt;
&lt;p&gt;The one special case is static methods in invocation position, as this was the only pre-existing place where qualified methods were allowed, and inference was previously used. For backwards compatibility, inference will still be used in this case (if no param-tags are provided).&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13684/use-arity-method-selection-disambiguation-where-possible?show=13694#a13694</guid>
<pubDate>Sun, 11 Feb 2024 21:46:13 +0000</pubDate>
</item>
<item>
<title>Answered: Validation that next Clojure version has no regression in language semantics with previous version</title>
<link>https://ask.clojure.org/index.php/13651/validation-clojure-regression-language-semantics-previous?show=13654#a13654</link>
<description>&lt;p&gt;In general, we do not change semantics, so they don't break. :)&lt;/p&gt;
&lt;p&gt;We do add new semantics and sometimes change error cases into new working semantics. The #1 way we avoid breakage is that we think really hard about what we're doing, which I know is out of fashion in software development, but we have a pretty good track record.&lt;/p&gt;
&lt;p&gt;From a binary compatibility perspective, there are a few policies we follow. We never make changes in Java implementation classes that may be invoked by compiled Clojure code (this is primarily code in RT and Reflector) - although we do add new methods or arities as needed. We also have similar policies around serialization changes, and around macros that introduce calls to new functions. We do not guarantee binary or serialization compatibility across versions (but we try hard to maintain that as much as possible).&lt;/p&gt;
&lt;p&gt;And also there are tests of course, although there are not a ton of those that directly check compilation for example, although all Clojure code is compiled so this is kind of implicitly checked in all tests.&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13651/validation-clojure-regression-language-semantics-previous?show=13654#a13654</guid>
<pubDate>Tue, 30 Jan 2024 19:17:24 +0000</pubDate>
</item>
<item>
<title>Executable 'java' not found on system path.</title>
<link>https://ask.clojure.org/index.php/13592/executable-java-not-found-on-system-path</link>
<description>&lt;p&gt;Hi guys I,m basically trying to run a clojure script app using a shadow file, to be honest i don't really know too much about clojure since this is a project that i downloaded, but i need it to make it run locally on windows 11 and i'm receiving the following error&lt;/p&gt;
&lt;p&gt;shadow-cljs - config: C:\Appsmiths\i\src\winglue\webglue\shadow-cljs.edn&lt;br&gt;
===== ERROR =================&lt;/p&gt;
&lt;h2&gt;Executable 'java' not found on system path.&lt;/h2&gt;
&lt;p&gt;I have java on my system of course and my environment variables are well configured, so i think it could be something inside of the shadow file, but i cannot identify what it is, if you can help me out with this it would be really helpful&lt;/p&gt;
&lt;p&gt;this is basically all the shadow config:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;;; shadow-cljs configuration
{:dependencies [
                [akiroz.re-frame/storage &quot;0.1.3&quot;]
                [bidi &quot;2.1.5&quot;]
                [com.cemerick/url &quot;0.1.1&quot;]
                [binaryage/devtools &quot;1.0.2&quot;]
                [binaryage/oops &quot;0.7.1&quot;]
                [com.cognitect/transit-cljs &quot;0.8.256&quot;]
                [com.rpl/specter &quot;1.1.3&quot;]
                [com.taoensso/timbre &quot;4.10.0&quot;]
                [cljs-http &quot;0.1.46&quot;]
                [day8.re-frame/async-flow-fx &quot;0.1.0&quot;]
                [day8.re-frame/http-fx &quot;0.1.6&quot;]
                [day8.re-frame/re-frame-10x &quot;1.5.0&quot;]
                [day8.re-frame/tracing &quot;0.5.1&quot;]
                [day8.re-frame/undo &quot;0.3.2&quot;]
                [district0x/graphql-query &quot;1.0.6&quot;]
                [district0x/re-frame-interval-fx &quot;1.0.2&quot;]
                [expound &quot;0.8.5&quot;]
                [funcool/cuerdas &quot;2021.05.29-0&quot;]
                [funcool/promesa &quot;2.0.1&quot;]
                [juji/editscript &quot;0.4.6&quot;]
                [maximgb/re-state &quot;1.5.0&quot;]
                [medley &quot;1.2.0&quot;]
                [metosin/spec-tools &quot;0.10.4&quot;]
                [org.clojure/data.json &quot;0.2.6&quot;]
                [org.clojure/spec.alpha &quot;0.2.187&quot;]
                [pez/clerk &quot;1.0.0&quot;]
                [prismatic/schema &quot;1.1.12&quot;]
                [re-frame &quot;1.3.0&quot;]
                [re-graph &quot;0.1.15&quot; :exclusions [cljs-http]]
                [com.andrewmcveigh/cljs-time &quot;0.5.2&quot;]
                [reagent &quot;1.1.1&quot;]
                [spyscope &quot;0.1.6&quot;]
                [venantius/accountant &quot;0.2.5&quot;]
                [lambdaisland/regal &quot;0.0.143&quot;]
                [cheshire &quot;5.11.0&quot;]
                [camel-snake-kebab &quot;0.4.3&quot;]
                [garden/garden-units &quot;1.0.0-RC2&quot;]
                [cljs-bean &quot;1.8.0&quot;]]

 :source-paths [&quot;lib&quot; &quot;graphql&quot; &quot;src&quot; &quot;C:/Appsmiths/i/src/winglue-artifact/webglue&quot; &quot;test&quot;]
 :nrepl {:port 41002}
 :open-file-command [&quot;idea &quot; :pwd &quot; --line &quot; :line :file]
 ;; webglue artifact are in /i/src/winglue-artifact/webglue/js
 :builds {:app {:output-dir &quot;C:/Appsmiths/i/src/winglue-artifact/webglue/js&quot;
                :asset-path &quot;/js&quot;
                :compiler-options
                {:optimizations :none
                 ;; use es2018 for recat-markdown-editor
                 :output-feature-set :es2018
                 :main webglue.core
                 :closure-warnings {:global-this :off}
                 :closure-defines {re-frame.trace/trace-enabled? true
                                   day8.re-frame-10x.debug?             true
                                   day8.re-frame.tracing.trace-enabled? true}
                 :external-config {:devtools/config {:features-to-install    [:formatters :hints]
                                                     :fn-symbol              &quot;Fn&quot;
                                                     :print-config-overrides true}}}
                :target :browser
                :js-options {:ignore-asset-requires true}
                :module-loader true
                :modules {:webglue
                          {:entries [webglue.core]}
                          :ag-grid
                          {:entries [webglue.components.ag-grid]
                           :depends-on #{:webglue}}
                          :dev
                          {:entries [webglue.pages.component-show-case webglue.pages.dev]
                           :depends-on #{:webglue}}
                          :plot
                          {:entries [webglue.component-generator.graph
                                     webglue.component-generator.ivsp-plot
                                     webglue.component-generator.pie-chart
                                     webglue.component-generator.bar-chart
                                     webglue.component-generator.bubble-chart]
                           :depends-on #{:webglue}}}
                :devtools {:repl-pprint true
                           :after-load webglue.core/reload!
                           :loader-mode :eval
                           :http-root &quot;C:/Appsmiths/i/src/winglue-artifact/webglue&quot;
                           :http-port 3333
                           :http-handler shadow.http.push-state/handle
                           :preloads [devtools.preload
                                      ; use only for debug re-frame, this option wil take 300 ms to reload and 330 file to watch
                                      ; run by uncomment next line, and save. shadow-cljs will do the rest
                                      day8.re-frame-10x.preload]}}
          :win-app {:output-dir &quot;C:/Appsmiths/i/src/winglue-artifact/webglue&quot;
                    :asset-path &quot;/js&quot;
                    :compiler-options
                    {:optimizations :none
                     :output-feature-set :es2018
                     :main webglue.core
                     :closure-warnings {:global-this :off}
                     :closure-defines {re-frame.trace/trace-enabled? true
                                       day8.re-frame-10x.debug?             true
                                       day8.re-frame.tracing.trace-enabled? true}
                     :external-config {:devtools/config {:features-to-install    [:formatters :hints]
                                                         :fn-symbol              &quot;Fn&quot;
                                                         :print-config-overrides true}}}
                    :target :browser
                    :js-options {:ignore-asset-requires true}
                    :modules {:webglue {:entries [webglue.core]}}
                    :devtools {:http-port 3434
                               :http-root &quot;C:/Appsmiths/i/src/winglue-artifact/webglue&quot;
                               :http-handler shadow.http.push-state/handle
                               :after-load webglue.core/reload!
                               :loader-mode :eval
                               :preloads [devtools.preload
                                          day8.re-frame-10x.preload]}}
          :test {:target :browser-test
                 :test-dir &quot;test-assets&quot;
                 :devtools {:http-port 9100
                            :http-root &quot;test-assets&quot;}
                 :runner-ns main-test-initial
                 :js-options {:ignore-asset-requires true}
                 :ns-regexp &quot;-test$&quot;}

          :app-release {:target :browser
                        :modules {:webglue
                                  {:entries [webglue.core]}}
                        :js-options {:ignore-asset-requires true}
                        :compiler-options {:source-map false
                                           :output-feature-set :es2018
                                           :main  webglue.core
                                           :closure-defines {}}
                        :release  {:output-dir &quot;C:/Appsmiths/i/src/winglue-artifact/webglue/js&quot;}}

          :tao2py-release {:target :browser
                           :js-options {:ignore-asset-requires true}
                           :compiler-options
                           {:source-map false
                            :output-feature-set :es2018
                            :main  webglue.core
                            :closure-defines {webglue.config/tao2py-release true
                                              ;; landing page is page key in webglue.route_pages
                                              webglue.config/landing-page &quot;field-overview&quot;}}
                           :release  {:output-dir &quot;C:/Appsmiths/i/src/winglue-artifact/webglue/js&quot;
                                      :asset-path &quot;/js&quot;}
                           :module-loader true
                           :modules {:webglue
                                     {:entries [webglue.core]}
                                     :ag-grid
                                     {:entries [webglue.components.ag-grid]
                                      :depends-on #{:webglue}}
                                     :dev
                                     {:entries [webglue.pages.component-show-case webglue.pages.dev]
                                      :depends-on #{:webglue}}
                                     :plot
                                     {:entries [webglue.component-generator.graph
                                                webglue.component-generator.ivsp-plot
                                                webglue.component-generator.pie-chart
                                                webglue.component-generator.bar-chart
                                                webglue.component-generator.bubble-chart]
                                      :depends-on #{:webglue}}}}

          :tao2py-testing {:target :browser
                           :modules {:webglue
                                     {:entries [webglue.core]}}
                           :js-options {:ignore-asset-requires true}
                           :compiler-options {:source-map false
                                              :output-feature-set :es2018
                                              :main  webglue.core
                                              :closure-defines {}}
                           :release  {:output-dir &quot;C:/Appsmiths/i/src/winglue-artifact/webglue/js&quot;}}

          :budger-release {:target :browser
                           :modules {:webglue {:entries [webglue.core]}}
                           :release {:output-dir &quot;release/js&quot;}
                           :js-options {:ignore-asset-requires true}
                           :compiler-options {:source-map false
                                              :output-feature-set :es2018
                                              :main       webglue.core
                                              :closure-defines {}}}}}
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13592/executable-java-not-found-on-system-path</guid>
<pubDate>Wed, 03 Jan 2024 19:38:51 +0000</pubDate>
</item>
<item>
<title>Answered: Is clojure.lang.Compiler/analyze safe to use?</title>
<link>https://ask.clojure.org/index.php/13476/is-clojure-lang-compiler-analyze-safe-to-use?show=13478#a13478</link>
<description>&lt;p&gt;It's not considered part of the public API and will return internal classes in the Compiler, which may not be fully accessible in some cases (it has not been designed for this). Those classes also change regularly between releases.&lt;/p&gt;
&lt;p&gt;Depending on your needs, you might want to consider &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/tools.analyzer&quot;&gt;https://github.com/clojure/tools.analyzer&lt;/a&gt; and &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/tools.analyzer.jvm&quot;&gt;https://github.com/clojure/tools.analyzer.jvm&lt;/a&gt;.&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13476/is-clojure-lang-compiler-analyze-safe-to-use?show=13478#a13478</guid>
<pubDate>Mon, 20 Nov 2023 14:04:27 +0000</pubDate>
</item>
<item>
<title>Answered: 'Method size too large!' compiling a `case` expression with unfortunate clause hashes</title>
<link>https://ask.clojure.org/index.php/13407/method-large-compiling-expression-unfortunate-clause-hashes?show=13414#a13414</link>
<description>&lt;p&gt;Logged as &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2808&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2808&lt;/a&gt;&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13407/method-large-compiling-expression-unfortunate-clause-hashes?show=13414#a13414</guid>
<pubDate>Thu, 26 Oct 2023 20:49:54 +0000</pubDate>
</item>
<item>
<title>Answered: Compiler bug with lazy-seq getting quoted</title>
<link>https://ask.clojure.org/index.php/13255/compiler-bug-with-lazy-seq-getting-quoted?show=13256#a13256</link>
<description>&lt;p&gt;Is there some scenario where this is relevant?&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13255/compiler-bug-with-lazy-seq-getting-quoted?show=13256#a13256</guid>
<pubDate>Tue, 05 Sep 2023 23:31:17 +0000</pubDate>
</item>
<item>
<title>Answered: Special symbols can be shadowed inconsistently</title>
<link>https://ask.clojure.org/index.php/1132/special-symbols-can-be-shadowed-inconsistently?show=13239#a13239</link>
<description>&lt;p&gt;Writing a &quot;fix&quot; for this, to throw if a var or local would shadow a special was surprisingly not too bad. However, just in clojure itself there are many instances of &lt;code&gt;var&lt;/code&gt; and &lt;code&gt;new&lt;/code&gt; and others used in let bindings.&lt;/p&gt;
&lt;p&gt;Maybe instead of throwing an error it could print something: &quot;WARNING: shadowing a special symbol is naughty and should not be done!&quot; That's already done in a couple places when defining new vars or in let binds.&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/1132/special-symbols-can-be-shadowed-inconsistently?show=13239#a13239</guid>
<pubDate>Wed, 30 Aug 2023 18:02:13 +0000</pubDate>
</item>
<item>
<title>Answered: 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=13179#a13179</link>
<description>&lt;p&gt;That repro doesn't run for me (from the linked branch), I get &quot;Namespace could not be loaded: lint&quot;.&lt;/p&gt;
&lt;p&gt;I think the actual problem is the reverse of the title - the whole point of default methods is that the implementing class doesn't have to implement the interface's default method. What's actually happening though is that the genclass &lt;em&gt;is&lt;/em&gt; generating a method implementation of the default method &lt;code&gt;otherthing&lt;/code&gt; that calls through to the Clojure var &lt;code&gt;-otherthing&lt;/code&gt; (which is how genclass works but retains the dynamic nature of Clojure).&lt;/p&gt;
&lt;p&gt;You can infer this from the error message: &quot;UnsupportedOperationException: otherthing (clojure-sample.foo/-otherthing not defined?)&quot;. In &quot;otherthing&quot;, it's trying to call &quot;-otherthing&quot;.&lt;/p&gt;
&lt;p&gt;Logged as &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2794&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2794&lt;/a&gt;&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=13179#a13179</guid>
<pubDate>Mon, 21 Aug 2023 19:51:35 +0000</pubDate>
</item>
<item>
<title>Answered: Create/get symbol of class instance?</title>
<link>https://ask.clojure.org/index.php/13062/create-get-symbol-of-class-instance?show=13069#a13069</link>
<description>&lt;p&gt;The easiest way to do this is:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(case (.getName (class c))
  &quot;java.lang.String&quot; &quot;We got a string!&quot;
  &quot;[[I&quot;              &quot;An array of arrays of int.&quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I suggest just using strings rather than trying to make them symbols because Java class names can get funky, with leading square brackets if it is an array, and embedded dollar signs if it is a nested class.&lt;/p&gt;
&lt;p&gt;Also keep in mind that just a name is not enough to uniquely identify a class; you may have classes with the same name loaded by different class loaders which are not mutually compatible with each other. For most situations where you are thinking about this kind of a &lt;code&gt;case&lt;/code&gt; expression, however, this probably won’t be an issue.&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13062/create-get-symbol-of-class-instance?show=13069#a13069</guid>
<pubDate>Tue, 04 Jul 2023 01:26:37 +0000</pubDate>
</item>
<item>
<title>Answered: Is a bytecode file generated after the Clojure code compilation?</title>
<link>https://ask.clojure.org/index.php/13037/bytecode-file-generated-after-the-clojure-code-compilation?show=13038#a13038</link>
<description>&lt;p&gt;In general, all Clojure code is compiled to bytecode in classes. If running from source, this is done dynamically and loaded using a custom classloader. Optionally you can compile code &quot;ahead of time&quot; and produce .class files on disk using the &lt;code&gt;compile&lt;/code&gt; function.&lt;/p&gt;
&lt;p&gt;Some simple top-level expressions evaluated at the repl are simply evaluated without compiling and loading classes.&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13037/bytecode-file-generated-after-the-clojure-code-compilation?show=13038#a13038</guid>
<pubDate>Tue, 27 Jun 2023 22:24:50 +0000</pubDate>
</item>
<item>
<title>Answered: Macro-expansion hooks similar to clojure spec</title>
<link>https://ask.clojure.org/index.php/12956/macro-expansion-hooks-similar-to-clojure-spec?show=12971#a12971</link>
<description>&lt;p&gt;Logged as &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2780&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2780&lt;/a&gt;&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12956/macro-expansion-hooks-similar-to-clojure-spec?show=12971#a12971</guid>
<pubDate>Tue, 30 May 2023 04:58:53 +0000</pubDate>
</item>
<item>
<title>Answered: Why does the Clojure compiler give different output for the same input?</title>
<link>https://ask.clojure.org/index.php/12925/why-does-clojure-compiler-give-different-output-same-input?show=12926#a12926</link>
<description>&lt;p&gt;There are a few different reasons this can happen, but two of the main reasons are state being held in unordered Clojure collections (sets or maps) during compilation, or relying on the (arbitrary) result order returned from Java reflection APIs.&lt;/p&gt;
&lt;p&gt;We do not consider it a priority to make Clojure builds repeatable, but we are happy to evaluate such issues and fix when it makes sense. (Example from 1.11: &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-1973&quot;&gt;https://clojure.atlassian.net/browse/CLJ-1973&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Working with a whole Docker thing is a lot - if you can narrow this down to a specific problem, I'm happy to file a jira with it.&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12925/why-does-clojure-compiler-give-different-output-same-input?show=12926#a12926</guid>
<pubDate>Mon, 08 May 2023 14:58:10 +0000</pubDate>
</item>
<item>
<title>Answered: Macro symbols in &amp;env don't get updated when shadowed, still contain the outer symbol instead.</title>
<link>https://ask.clojure.org/index.php/12598/macro-symbols-updated-shadowed-still-contain-symbol-instead?show=12607#a12607</link>
<description>&lt;p&gt;Logged as &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2745&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2745&lt;/a&gt;&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12598/macro-symbols-updated-shadowed-still-contain-symbol-instead?show=12607#a12607</guid>
<pubDate>Mon, 30 Jan 2023 19:45:38 +0000</pubDate>
</item>
<item>
<title>Answered: let binding does not infer primitive type of type hinted global var</title>
<link>https://ask.clojure.org/index.php/12599/let-binding-does-not-infer-primitive-type-type-hinted-global?show=12604#a12604</link>
<description>&lt;p&gt;Regardless of the type hint here, vars are always Objects and it will be a boxed value in the example usage (so not a primitive). However, if marked as a ^:const AND a primitive, the compiler will inline the var in the let with a primitive long and in that case it &lt;em&gt;will&lt;/em&gt; be a primitive.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(set! *unchecked-math* :warn-on-boxed)

(def ^{:tag 'long :const true} k 100)

(let [i k] (+ i 10)))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;will not warn. :const is often used incorrectly, but this is a good usage for it.&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12599/let-binding-does-not-infer-primitive-type-type-hinted-global?show=12604#a12604</guid>
<pubDate>Mon, 30 Jan 2023 19:04:28 +0000</pubDate>
</item>
<item>
<title>Answered: Finer-grained control over direct-linking</title>
<link>https://ask.clojure.org/index.php/12488/finer-grained-control-over-direct-linking?show=12493#a12493</link>
<description>&lt;p&gt;On some particular points:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Would someone want to redefine a clojure.core function for the code they run while being content with an old version still being used by some other code? &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;People do do this, whether it's a good idea or not. &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/generateme/fastmath&quot;&gt;https://github.com/generateme/fastmath&lt;/a&gt; is one example.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;My second point is that a blanket DL usually brings quite unsubstantial performance improvements&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;There's more to direct linking than just the perf improvements (which, as you say, are usually not significant other than hot loop code). In particular, not needing to load a var for linking significantly reduces the static initializer and constant pool size, resulting in smaller class sizes and reduced load times. Doing DL on a broad basis makes that significant (clojure.core is particularly big so this is magnified there). If we added lazy var loading, that plus DL would additionally improve that.&lt;/p&gt;
&lt;p&gt;All that said, I think there are probably ways that DL could be open to more targeted use, and signalling to consumers of a function might be helpful (kind of the opposite of ^:redef - &quot;please direct link me&quot;). But I think it would be best to work this from the angle of &quot;I am trying to do X and can't&quot;, and I'm not hearing that kind of a request here. Or alternately - why is DL not used when it could be? Maybe it's just a lack of awareness or maybe it's because it does not work well with other features or workflows.&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12488/finer-grained-control-over-direct-linking?show=12493#a12493</guid>
<pubDate>Wed, 21 Dec 2022 19:11:22 +0000</pubDate>
</item>
<item>
<title>Answered: volatile-mutable not recognized in some deftype method subforms</title>
<link>https://ask.clojure.org/index.php/12491/volatile-mutable-recognized-some-deftype-method-subforms?show=12492#a12492</link>
<description>&lt;p&gt;Logged as &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2743&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2743&lt;/a&gt;&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12491/volatile-mutable-recognized-some-deftype-method-subforms?show=12492#a12492</guid>
<pubDate>Wed, 21 Dec 2022 19:01:12 +0000</pubDate>
</item>
<item>
<title>Answered: How to solve the error I get in the console? - Clojure</title>
<link>https://ask.clojure.org/index.php/12448/how-to-solve-the-error-i-get-in-the-console-clojure?show=12451#a12451</link>
<description>&lt;ol&gt;
&lt;li&gt;&lt;p&gt;You should have inspected &amp;amp; included the stack traces in /tmp/clojure-4521524603536338044.edn (the file path is in the error message).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The problem might be in the &lt;code&gt;cond&lt;/code&gt; statement:&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code&gt;(cond
     (= input_ &quot;1&quot;) 
     ((println &quot;Table of customers: &quot;)
     (run! println (load-data &quot;cust.txt&quot;)))) 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If &lt;code&gt;input_&lt;/code&gt; is &quot;1&quot;, then the clause &lt;code&gt;((println &quot;Table of customers: &quot;) (run! println (load-data &quot;cust.txt&quot;)))&lt;/code&gt; runs. If we expand the parenthesis slowly, that becomes:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;(nil nil)&lt;/code&gt; &lt;/p&gt;
&lt;p&gt;(&lt;code&gt;println&lt;/code&gt; evaluates to nil), which Clojure interprets as a function call, executing &lt;code&gt;nil&lt;/code&gt; with 1 argument. Since &lt;code&gt;nil&lt;/code&gt; isn't a function, it throws an exception. I ran that in Clojure 1.11.1 though and got a slightly different error message though.&lt;/p&gt;
&lt;p&gt;The fix is to have a `(do ...) loop around the printing in the cond.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;You look like you are learning Clojure. As a point of advice, the language is designed to use &lt;code&gt;(let)&lt;/code&gt;  instead of &lt;code&gt;(def input_ (readline))&lt;/code&gt; and &lt;code&gt;recur&lt;/code&gt; instead of the recursive call to &lt;code&gt;menu&lt;/code&gt;. Well done on finding &lt;code&gt;cond&lt;/code&gt; that is a good function here.&lt;/li&gt;
&lt;/ol&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12448/how-to-solve-the-error-i-get-in-the-console-clojure?show=12451#a12451</guid>
<pubDate>Fri, 09 Dec 2022 11:36:08 +0000</pubDate>
</item>
<item>
<title>Answered: Bytecode not 100% deterministic given identical inputs?</title>
<link>https://ask.clojure.org/index.php/12249/bytecode-not-100-deterministic-given-identical-inputs?show=12252#a12252</link>
<description>&lt;p&gt;This is not a high priority goal for us. Which is not to say we wouldn't consider a change if it was solving an actual problem for someone.&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12249/bytecode-not-100-deterministic-given-identical-inputs?show=12252#a12252</guid>
<pubDate>Tue, 27 Sep 2022 15:52:15 +0000</pubDate>
</item>
<item>
<title>Answered: Why does Clojure generate too many .class files?</title>
<link>https://ask.clojure.org/index.php/12145/why-does-clojure-generate-too-many-class-files?show=12212#a12212</link>
<description>&lt;p&gt;I am curious as to what concrete side effect of 'too many class files' you are seeing?  Larger jars, long require times, etc?  &lt;/p&gt;
&lt;p&gt;Which aspect of the large number of class files are you seeking to optimize?&lt;/p&gt;
&lt;p&gt;How many class files are too many?&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12145/why-does-clojure-generate-too-many-class-files?show=12212#a12212</guid>
<pubDate>Sun, 18 Sep 2022 13:40:46 +0000</pubDate>
</item>
<item>
<title>Answered: How to require a symbol from within a function?</title>
<link>https://ask.clojure.org/index.php/11922/how-to-require-a-symbol-from-within-a-function?show=11926#a11926</link>
<description>&lt;p&gt;Why not just use requiring-resolve?&lt;/p&gt;
&lt;p&gt;Edit, for more detail:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(comment
  (-&amp;gt;&amp;gt; [1 2]
       (reduce (fn [acc v]
                 ((requiring-resolve 'clojure.set/union) acc #{v}))
         #{}))
  ;;=&amp;gt; #{1 2}
  )
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As I learned talking to Peter (op) offline, the reason that specific piece of code doesn't work is named the &lt;a rel=&quot;nofollow&quot; href=&quot;https://technomancy.us/143&quot;&gt;Gilardi scenario&lt;/a&gt;. An extended description of the problem is available at &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojuredocs.org/clojure.core/require#example-629749b2e4b0b1e3652d75f7&quot;&gt;ClojureDocs&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Another reason to prefer &lt;code&gt;requiring-resolve&lt;/code&gt; when possible is that &lt;code&gt;require&lt;/code&gt; is not thread-safe as of Clojure 1.11.1. More details about this can be found (among others) in &lt;a rel=&quot;nofollow&quot; href=&quot;https://ask.clojure.org/index.php/9893/require-is-not-thread-safe&quot;&gt;this question&lt;/a&gt;, and on ClojureDocs &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojuredocs.org/clojure.core/require#example-5fda2a16e4b0b1e3652d7419&quot;&gt;here&lt;/a&gt; and &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojuredocs.org/clojure.core/require#example-62988531e4b0b1e3652d75f8&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11922/how-to-require-a-symbol-from-within-a-function?show=11926#a11926</guid>
<pubDate>Wed, 01 Jun 2022 16:33:43 +0000</pubDate>
</item>
<item>
<title>need help with compiler error &quot;unresolved symbol&quot;</title>
<link>https://ask.clojure.org/index.php/11564/need-help-with-compiler-error-unresolved-symbol</link>
<description>&lt;p&gt;Hi &lt;br&gt;
I cloned &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/unclebob/Euler&quot;&gt;this&lt;/a&gt; project, and used VScode to open it. I added Calva, and am half way through the tutorial. I do know what &quot;unresolved symbol&quot; means, but do not know how to fix in a Clojure project especially that this was a working project. I know that the author used Intellij, and I believe it was the ultimate edition. I have the community ( I am ware of the eval, and will use it if I do not have other option. I just like to know how to fix this myself). I am able to run the fire-up tutorial that Calvo comes with, but the compiler error is still there. &lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11564/need-help-with-compiler-error-unresolved-symbol</guid>
<pubDate>Fri, 11 Feb 2022 17:59:34 +0000</pubDate>
</item>
<item>
<title>VerifyError caused by combination of protocols, primitive type hints, `min`</title>
<link>https://ask.clojure.org/index.php/11554/verifyerror-caused-combination-protocols-primitive-hints</link>
<description>&lt;p&gt;related to &lt;a rel=&quot;nofollow&quot; href=&quot;https://ask.clojure.org/index.php/11553/arrayindexoutofboundsexception-in-clojure-asm-frame&quot;&gt;https://ask.clojure.org/index.php/11553/arrayindexoutofboundsexception-in-clojure-asm-frame&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defprotocol P
  (^double p1 [p a])
  (^double p2 [p a]))

(let [p (reify P)]
  (min 0.0
       (case :p1
         :p1 (p1 p :foo)
         Double/MAX_VALUE)))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;yields&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Execution error (VerifyError) at java.lang.Class/getDeclaredConstructors0 (Class.java:-2).
Inconsistent stackmap frames at branch target 121
Exception Details:
  Location:
    user$eval1401301.invokeStatic()Ljava/lang/Object; @115: goto
  Reason:
    Current frame's stack size doesn't match stackmap.
  Current Frame:
    bci: @115
    flags: { }
    locals: { null, 'clojure/lang/Keyword' }
    stack: { double, double_2nd, 'java/lang/Object' }
  Stackmap Frame:
    bci: @121
    flags: { }
    locals: { 'clojure/lang/IObj', 'clojure/lang/Keyword' }
    stack: { double, double_2nd, top, top }
  Bytecode:
    0000000: bb00 0f59 01b7 0012 c000 14b2 0018 c000
    0000010: 1ab9 001e 0200 4b0e b200 224c 2bb8 0028
    0000020: aa00 0000 0000 0056 3c72 5a61 3c72 5a61
    0000030: 0000 0014 2bb2 0022 a600 3e2a 014b 59b8
    0000040: 002c b200 2ea5 0011 59c1 0030 9a00 1c59
    0000050: b800 2cb3 002e b200 34b6 0039 5fb2 003c
    0000060: b900 4203 00a7 000e c000 30b2 003c b900
    0000070: 4602 00a7 0006 b200 4cb8 0054 b800 58b0
    0000080:                                        
  Stackmap Table:
    full_frame(@52,{Object[#20],Object[#91]},{Double})
    full_frame(@86,{Null,Object[#91]},{Double,Object[#20]})
    full_frame(@104,{Null,Object[#91]},{Double,Object[#20]})
    full_frame(@115,{Null,Object[#91]},{Double,Object[#93]})
    full_frame(@118,{Object[#20],Object[#91]},{Double})
    full_frame(@121,{Object[#20],Object[#91]},{Double,Top,Top})
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Repro'd against 1.10.3 and 1.11.0-beta1&lt;/p&gt;
&lt;p&gt;Let me know if you'd like me to submit this to JIRA :)&lt;/p&gt;
&lt;p&gt;James&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11554/verifyerror-caused-combination-protocols-primitive-hints</guid>
<pubDate>Tue, 08 Feb 2022 13:41:54 +0000</pubDate>
</item>
</channel>
</rss>