<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Recent questions tagged reify</title>
<link>https://ask.clojure.org/index.php/tag/reify</link>
<description></description>
<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>Why is reified clojure.lang.IDeref wrapping a promise blocking?</title>
<link>https://ask.clojure.org/index.php/12061/why-reified-clojure-lang-ideref-wrapping-promise-blocking</link>
<description>&lt;p&gt;Using clojure 1.10.3:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;user&amp;gt; (def p (promise))
#'user/p
user&amp;gt; (def wrapper
        (reify
          clojure.lang.IDeref
          (deref [_] @p)))
#'user/wrapper
user&amp;gt; wrapper ;; =&amp;gt; repl hangs here
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In above session the repl blocks on the last statement. I do not see why that is. I would expect &lt;code&gt;@wrapper&lt;/code&gt; to block, evaluating &lt;code&gt;wrapper&lt;/code&gt; however I expected it to return an Object of some kind. Am I missing something here?&lt;/p&gt;
</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12061/why-reified-clojure-lang-ideref-wrapping-promise-blocking</guid>
<pubDate>Thu, 21 Jul 2022 20:01:55 +0000</pubDate>
</item>
</channel>
</rss>