<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Recent questions tagged metadata</title>
<link>https://ask.clojure.org/index.php/tag/metadata</link>
<description></description>
<item>
<title>`eval` using functions with metadata</title>
<link>https://ask.clojure.org/index.php/15115/eval-using-functions-with-metadata</link>
<description>&lt;p&gt;TIL:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(eval (list + 1 2)) ; works
(eval (list (var-get #'+) 1 2)) ; works
(eval (list (fn [a b] (+ a b)) 1 2)) ; works

(defmacro m [] `(~(fn [a b] (+ a b)) 1 2))
(m) ; also works

;; however, if the function has any metadata:
(eval (list (with-meta + {}) 1 2))
;; ^ fails, No matching ctor found for class clojure.lang.AFunction$1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This was unintuitive to discover.&lt;/p&gt;
&lt;p&gt;I solved it locally with a little helper:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defn val-&amp;gt;expr [v]
  (if (symbol? v)
    `'~v
    (cond-&amp;gt; v
      (and (fn? v) (not (nil? (meta v))))
      (-&amp;gt; (with-meta nil)
          (list (-&amp;gt; v meta (update-vals val-&amp;gt;expr)))
          (conj `with-meta)))))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But this takes special handling. I wonder if something similar would not be possible on a &quot;matching ctor&quot;-level, possibly also for &lt;code&gt;comp&lt;/code&gt;, &lt;code&gt;every-pred?&lt;/code&gt;, etc. It would be fairly trivial even in userland to have versions of these functions which carry metadata sufficient to recreate expressions, e.g. &lt;code&gt;comp&lt;/code&gt; storing the list of functions, and then &lt;code&gt;eval&lt;/code&gt;, on encountering &lt;code&gt;No matching ctor found for class clojure.core$comp$fn__5921&lt;/code&gt;, can instead pull out the list of functions from that value and evaluate &lt;code&gt;(list* comp (:composed-fns (meta v)))&lt;/code&gt; (or some such) instead.&lt;/p&gt;
&lt;p&gt;I think this would be great to have in the core lib, at least for metadata and core libs functions like &lt;code&gt;comp&lt;/code&gt;, &lt;code&gt;some-fn&lt;/code&gt;, &lt;code&gt;every-pred?&lt;/code&gt;, and &lt;code&gt;complement&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Note, I'm not talking about adding or changing ctors for these necessarily. A hook for taking unconstructable values and making a constructable value out of them would serve just as well, maybe even a multifn.&lt;/p&gt;
&lt;p&gt;Strictly in userland and without core lib support, I suppose the cleanest way to do something like this is a custom protocol and probably monkeypatch some core libs functions (maybe &lt;code&gt;eval&lt;/code&gt;?)&lt;/p&gt;
&lt;p&gt;So I suppose my questions are:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Is this something you agree would be good to have in general? Or is this by design for some reason I can't see?&lt;/li&gt;
&lt;li&gt;Would this be good and practical to have in the corelib? Oughtn't be a breaking change at least&lt;/li&gt;
&lt;li&gt;If no, is there currently any sane way to apply my solution in a more systemic way than wrapping every relevant value with a &lt;code&gt;val-&amp;gt;expr&lt;/code&gt; call?&lt;/li&gt;
&lt;/ol&gt;
</description>
<category>Syntax and reader</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15115/eval-using-functions-with-metadata</guid>
<pubDate>Mon, 01 Jun 2026 14:33:00 +0000</pubDate>
</item>
<item>
<title>Is it valid for metadata to have metadata?</title>
<link>https://ask.clojure.org/index.php/14927/is-it-valid-for-metadata-to-have-metadata</link>
<description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I am implementing a pretty printer and while adding/testing support for &lt;code&gt;*print-meta*&lt;/code&gt; I noticed that &lt;code&gt;pr&lt;/code&gt; prints an object whose metadata has metadata in the following way:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;user&amp;gt; (binding [*print-meta* true]
        (pr-str (with-meta 'foo (with-meta {:bar :baz} {:frob :zork}))))
&quot;^^{:frob :zork} {:bar :baz} foo&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;When reading such a form, only the &quot;outermost&quot; metadata is preserved:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;user&amp;gt; (binding [*print-meta* true]
        (let [s (pr-str (with-meta 'foo (with-meta {:bar :baz} {:frob :zork})))
              o (clojure.edn/read-string s)]
          {:o o
           :meta (meta o)
           :metameta (meta (meta o))}))
{:o foo, :meta {:bar :baz}, :metameta nil}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The behaviour is the same for &lt;code&gt;clojure.core/read-string&lt;/code&gt; and also the &lt;code&gt;tools.reader&lt;/code&gt; readers.&lt;/p&gt;
&lt;p&gt;Can anyone clarify for me if this is either:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;simply GIGO&lt;/li&gt;
&lt;li&gt;a bug in the printer&lt;/li&gt;
&lt;li&gt;a bug in the readers&lt;/li&gt;
&lt;li&gt;a state that should be somehow disallowed&lt;/li&gt;
&lt;li&gt;something else?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Neither the &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.org/reference/metadata&quot;&gt;metadata reference&lt;/a&gt; nor the &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.org/reference/reader#metadata&quot;&gt;reader reference&lt;/a&gt; explicitly allow or disallow such a thing, as far as I can tell. Should they?&lt;/p&gt;
&lt;p&gt;N.B. this is not an issue in any kind of production context and I'm not aware of any library or program that constructs such a thing. It's simply something I tested to see if/how it would break the pretty printer I'm building.&lt;/p&gt;
&lt;p&gt;EDIT:&lt;/p&gt;
&lt;p&gt;I dug into this some more with Nicola. Here's a perhaps much clearer case that demonstrates the reader isn't propagating nested metadata:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;user&amp;gt; (let [o ^^:foo {1 2} {3 4}]
        {:o o :meta (meta o) :metameta (meta (meta o))})
{:o {3 4}, :meta {1 2}, :metameta nil}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;:metameta&lt;/code&gt; should be &lt;code&gt;{:foo true}&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;In &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LispReader.java#L979-L982&quot;&gt;this section of MetaReader.invoke&lt;/a&gt; we are iterating over the entries of the meta map and manually associng them into the existing meta of the object; any metadata on the meta map itself is not preserved. I have a patch that adds a failing test case and correctly propagates the the meta map's metadata. If this is worth a ticket then I'm more than happy to attach it to that or send it to you directly.&lt;/p&gt;
</description>
<category>Metadata</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14927/is-it-valid-for-metadata-to-have-metadata</guid>
<pubDate>Thu, 12 Feb 2026 15:45:20 +0000</pubDate>
</item>
<item>
<title>File and location data on namespaces</title>
<link>https://ask.clojure.org/index.php/14546/file-and-location-data-on-namespaces</link>
<description>&lt;h3&gt;Preamble&lt;/h3&gt;
&lt;p&gt;Two thoughts:&lt;/p&gt;
&lt;p&gt;Namespaces are not tied to files; they can be created and removed as desired. However, both idiomatically and through &lt;code&gt;clojure.core&lt;/code&gt;, they are &lt;em&gt;typically&lt;/em&gt; tied to files, being specified at the top of a file that shares the same name: &lt;code&gt;src/noahtheduke/splint/rules.clj&lt;/code&gt; holds a single namespace &lt;code&gt;noahtheduke.splint.rules&lt;/code&gt;, which is declared before all other forms. This is enforced in &lt;code&gt;require&lt;/code&gt; and &lt;code&gt;use&lt;/code&gt; calls: &lt;code&gt;(require '[noahtheduke.foo.bar :as fb])&lt;/code&gt; will find a file at &lt;code&gt;src/noahtheduke/bar.clj&lt;/code&gt; and then once the file is loaded will attempt to find the namespace &lt;code&gt;noahtheduke.bar&lt;/code&gt; and raise an error if it does not exist.&lt;/p&gt;
&lt;p&gt;In the compiler, &lt;code&gt;DefExpr&lt;/code&gt; will add to the created var's metadata location data in the form of &lt;code&gt;:line&lt;/code&gt;, &lt;code&gt;:column&lt;/code&gt;, and &lt;code&gt;:file&lt;/code&gt;. The first two come from the seq and latter from &lt;code&gt;*file*&lt;/code&gt;. This allows for introspection and analysis from tooling, and for better error handling in exceptions and messages.&lt;/p&gt;
&lt;h3&gt;Desired functionality&lt;/h3&gt;
&lt;p&gt;I have a collection of namespaces. I want to slurp the corresponding files (if they exist) to analyze and modify with rewrite-clj.&lt;/p&gt;
&lt;h3&gt;Discussion&lt;/h3&gt;
&lt;p&gt;Right now, I use metadata on vars to find relevant objects in code and then find the file that way:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defn get-path-from-var [var']
  (let [f (:file (meta var'))
        path (or (some-&amp;gt; f
                         (#(.. (Thread/currentThread)
                               (getContextClassLoader)
                               (getResource %)))
                         (io/file)
                         (str))
                 f)]
    {:path path
     :file (when (and path (.exists (io/file path)))
             (slurp path))}))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;However, that requires users to use the &lt;code&gt;defcram&lt;/code&gt; macro I've written, which limits the potential for inline-usage of my primary macro &lt;code&gt;compare-output&lt;/code&gt; (such as in a &lt;code&gt;deftest&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;I want to be able to use &lt;code&gt;*ns*&lt;/code&gt; in &lt;code&gt;compare-output&lt;/code&gt; to potentially find where the macro is being called, so I can perform the analysis and desired diffing. This would most easily be done by having location metadata on namespaces.&lt;/p&gt;
&lt;p&gt;But more importantly than just my library, I think having location metadata on namespaces would be a genuine help for many tools (such as eastwood, tools.namespace, CIDER, kibit, splint, etc). &lt;/p&gt;
&lt;h3&gt;Solutions&lt;/h3&gt;
&lt;p&gt;I'm only going to discuss one solution because this is an Ask, not a jira ticket lol.&lt;/p&gt;
&lt;p&gt;I think adding the location metadata in the &lt;code&gt;ns&lt;/code&gt; macro is the best place to put it. The &lt;code&gt;ns&lt;/code&gt; macro is the preferred way to create a new namespace. Creating namespaces with &lt;code&gt;in-ns&lt;/code&gt; or &lt;code&gt;create-ns&lt;/code&gt; requires additional steps to make the namespace usable, and neither is a macro to hold &lt;code&gt;&amp;amp;form&lt;/code&gt; metadata, increasing the work of adding location metadata.&lt;/p&gt;
</description>
<category>Metadata</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14546/file-and-location-data-on-namespaces</guid>
<pubDate>Fri, 16 May 2025 14:46:20 +0000</pubDate>
</item>
<item>
<title>what does ^:once meta applied for anon function mean?</title>
<link>https://ask.clojure.org/index.php/13050/what-does-once-meta-applied-for-anon-function-mean</link>
<description>&lt;p&gt;hi!&lt;br&gt;
what does ^:once meta applied for anon function mean?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(db-query-with-resultset* db sql params
                           (^:once fn* [rset]
                             (process-result-set rset opts))
                          opts)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Thanks &lt;/p&gt;
</description>
<category>Metadata</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13050/what-does-once-meta-applied-for-anon-function-mean</guid>
<pubDate>Sun, 02 Jul 2023 13:07:57 +0000</pubDate>
</item>
<item>
<title>Are there plans for official docs (rationale and guide) on datafy / nav?</title>
<link>https://ask.clojure.org/index.php/11032/are-there-plans-for-official-docs-rationale-and-guide-datafy</link>
<description>&lt;p&gt;If Clojure is to become (even) more data oriented, these are powerful tools to achieve that goal. The community needs support to encourage adoption.&lt;/p&gt;
&lt;p&gt;The current state of documentation for &lt;code&gt;datafy&lt;/code&gt; and &lt;code&gt;nav&lt;/code&gt; is not sufficient IMHO to encourage independent learning on a broad scale.&lt;/p&gt;
&lt;p&gt;There is no canonical source of such documentation in the community despite some valiant efforts (eg @SeanCorfield who has a &lt;a rel=&quot;nofollow&quot; href=&quot;https://corfield.org/blog/2018/12/03/datafy-nav/&quot;&gt;great blog post&lt;/a&gt; and is an active proponent). &lt;/p&gt;
&lt;p&gt;Examples are difficult to find around the internet ... &lt;a rel=&quot;nofollow&quot; href=&quot;https://gist.github.com/sashton/56a14d275c71d7ce3e224c11c9a16bd4&quot;&gt;here's a good one&lt;/a&gt; from a Slack recommendation by @Frederick on there.&lt;/p&gt;
&lt;p&gt;We know that there are problems with Slack since we cannot easily search history so keeping it here might help people find it in the meantime.&lt;/p&gt;
&lt;p&gt;It would be good to have a rationale explaining the problem it is solving, the general approach and some specifics on the design.&lt;/p&gt;
&lt;p&gt;Likewise a guide on how it should be used with a worked example and some hints and tips on how to approach implementations.&lt;/p&gt;
&lt;p&gt;I know it's marked as alpha but this has not prevented docs on other aspects of the language.&lt;/p&gt;
</description>
<category>Libs</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11032/are-there-plans-for-official-docs-rationale-and-guide-datafy</guid>
<pubDate>Sat, 11 Sep 2021 10:26:57 +0000</pubDate>
</item>
<item>
<title>which two objects share the same sequence?</title>
<link>https://ask.clojure.org/index.php/10756/which-two-objects-share-the-same-sequence</link>
<description>&lt;p&gt;The documentation for metadata &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.org/reference/metadata&quot;&gt;https://clojure.org/reference/metadata&lt;/a&gt; contains a confusing sentence which I think it grammatically incorrect.   &lt;/p&gt;
&lt;p&gt;The sentence is: One consequence of this is that applying metadata to a lazy sequence will realize the head of the sequence so that both objects can share the same sequence.&lt;/p&gt;
&lt;p&gt;Can someone please explain grammatically correctly what the 2nd sentence in the 3rd paragraph means?&lt;/p&gt;
&lt;p&gt;What are the two objects (both) in question and which sequence is shared between these two objects?&lt;/p&gt;
&lt;p&gt;Since the sentence is ambiguous, I'm not 100% sure what it means.  But here is my attempt to correct the sentence.  Please feel free to correct my incorrect-correction.&lt;/p&gt;
&lt;p&gt;That said, metadata and its relationship to an object, A,  is immutable - an object, B, with different metadata is a different object. One consequence of this is that applying metadata to A (if A is a lazy sequence) will realize the head of the sequence so that objects A and B can share the same meta-data.&lt;/p&gt;
&lt;p&gt;Additional discussions can be found here &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojurians.slack.com/archives/C03S1KBA2/p1625827141061700&quot;&gt;https://clojurians.slack.com/archives/C03S1KBA2/p1625827141061700&lt;/a&gt;&lt;/p&gt;
</description>
<category>Metadata</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10756/which-two-objects-share-the-same-sequence</guid>
<pubDate>Fri, 09 Jul 2021 11:17:12 +0000</pubDate>
</item>
<item>
<title>Is tag metadata that represents function calls useful?</title>
<link>https://ask.clojure.org/index.php/10716/is-tag-metadata-that-represents-function-calls-useful</link>
<description>&lt;p&gt;The following is valid Clojure (focus on &lt;code&gt;extend-type (class (log-window-proxy nil))&lt;/code&gt;, as opposed to refering to a class literal):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defn- log-window-proxy [state]
  (proxy [javax.swing.JTextArea clojure.lang.IDeref] []
    (deref [] state)
    (scrollRectToVisible [rect]
      (if @(:auto-scroll? state)
        (proxy-super scrollRectToVisible rect)))))

(defprotocol LogWindow
  (log   [this message])
  (clear [this]))

(extend-type (class (log-window-proxy nil))
  LogWindow
  (log [this message]
    (println &quot;message&quot; message))
  (clear [this]
    nil))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;However, when one inspects the :tag metadata that &lt;code&gt;this&lt;/code&gt; is given, it appears to have an somewhat odd form (since it remains a chain of calls, instead of a class literal):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(-&amp;gt; (extend-type (class (log-window-proxy nil))
      LogWindow
      (log [this message]
        (println &quot;message&quot; message))
      (clear [this]
        nil)) quote macroexpand last :log second ffirst meta)
;; =&amp;gt; {:tag (class (log-window-proxy nil))}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So, the :tag looks like a function call. Will the compiler end up invoking &lt;code&gt;(class (log-window-proxy ...&lt;/code&gt; to obtain a class that it can actually use as a type hint?&lt;/p&gt;
&lt;p&gt;Otherwise I'd be worried that this :tag metadata was invalid, which might cause reflection warnings and additionally confuse arbitrary third-party tooling.&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10716/is-tag-metadata-that-represents-function-calls-useful</guid>
<pubDate>Tue, 22 Jun 2021 10:08:17 +0000</pubDate>
</item>
<item>
<title>Bind *ns* and require before evaluating namespace metadata</title>
<link>https://ask.clojure.org/index.php/10005/bind-ns-and-require-before-evaluating-namespace-metadata</link>
<description>&lt;p&gt;Before evaluating its namespace metadata, I wish ns macro would:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Have &lt;code&gt;*ns*&lt;/code&gt; be bound already.&lt;/li&gt;
&lt;li&gt;:require, to be able to use :as namespace names in metadata expression.&lt;br&gt;
Example:&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Current (uses fully qualified names):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    (ns my.app.foo.controller
      {:tape.mvc/interceptors [(re-frame.core/path
                                [:my.app.foo.controller/controller])]}
      (:require [re-frame.core :as rf]
                [tape.mvc :as mvc]))

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After change (uses &quot;shortcut&quot; names):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    (ns my.app.foo.controller
      {::mvc/interceptors [(rf/path [::controller])]}
      (:require [re-frame.core :as rf]
                [tape.mvc :as mvc]))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Would this change be worthwile/acceptable/feasible?&lt;/p&gt;
</description>
<category>Metadata</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10005/bind-ns-and-require-before-evaluating-namespace-metadata</guid>
<pubDate>Tue, 05 Jan 2021 20:15:04 +0000</pubDate>
</item>
<item>
<title>Function with meta equality fails</title>
<link>https://ask.clojure.org/index.php/9966/function-with-meta-equality-fails</link>
<description>&lt;p&gt;Bug report:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defn f [] 1)
=&amp;gt; #'cljs.user/f
(= f (with-meta f {:a 1}))
=&amp;gt; false ;; should be true
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Per: &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.org/reference/metadata&quot;&gt;https://clojure.org/reference/metadata&lt;/a&gt;&lt;br&gt;
&quot;metadata does not impact equality&quot;&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/9966/function-with-meta-equality-fails</guid>
<pubDate>Wed, 23 Dec 2020 16:08:44 +0000</pubDate>
</item>
<item>
<title>How could I add metadata to specs?</title>
<link>https://ask.clojure.org/index.php/9414/how-could-i-add-metadata-to-specs</link>
<description>&lt;p&gt;I'm trying to implement traceability into my specs.&lt;br&gt;
(With &quot;specs&quot; I specifically mean &lt;code&gt;s/def&lt;/code&gt; and &lt;code&gt;s/fdef&lt;/code&gt; blocks.)&lt;/p&gt;
&lt;p&gt;Originally, I came up with the idea to use metadata for this. However, that's unfortunately not possible: the code below gives me a syntax error... (&lt;code&gt;Metadata can only be applied to IMetas.&lt;/code&gt;)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(require
    '[clojure.spec.alpha :as s])
(s/def
      ^{:rule &quot;205.3i&quot;
        :version &quot;2020.06.01&quot;}
      ::basic-land-type #{::forest ::island ::mountain ::plains ::swamp})
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The only other way I can think of is to somehow attach the metadata as a &quot;guardian&quot; element within the file (let's say, a &lt;code&gt;def&lt;/code&gt;)&lt;/p&gt;
&lt;p&gt;However, it seems quite ugly...&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(def
  ^{:rule &quot;205.3i&quot;
    :version &quot;2020.06.01&quot;}
  tracing-info &quot;(see metadata)&quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Would anyone know some way I could use to achieve this?&lt;/p&gt;
</description>
<category>Spec</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/9414/how-could-i-add-metadata-to-specs</guid>
<pubDate>Sun, 05 Jul 2020 02:10:12 +0000</pubDate>
</item>
<item>
<title>Why can't anonymous functions access their metadata unless they were created with some</title>
<link>https://ask.clojure.org/index.php/8774/anonymous-functions-access-their-metadata-unless-created</link>
<description>&lt;p&gt;These two expressions have a different result:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;((with-meta
   ^:any (fn self []
           (meta self))
   {:foo :bar}))

((with-meta
   (fn self []
           (meta self))
   {:foo :bar}))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The former returns &lt;code&gt;{:foo :bar}&lt;/code&gt; the latter returns &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;I'm guessing this is a bug, perhaps an unexpected consequence of an optimization?&lt;/p&gt;
&lt;p&gt;(Filed: &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJ-2539&quot;&gt;https://clojure.atlassian.net/browse/CLJ-2539&lt;/a&gt;)&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8774/anonymous-functions-access-their-metadata-unless-created</guid>
<pubDate>Sat, 26 Oct 2019 15:30:47 +0000</pubDate>
</item>
</channel>
</rss>