title: How to get function's name as string in Clojure?
body: <p>How can you get function's name as string in Clojure?</p>
  
  <p>What I have so far doesn't look anywhere near idiomatic:</p>
  
  <pre><code>(defn fn-name
    [f]
    (first (re-find #"(?&lt;=\$)([^@]+)(?=@)" (str f))))
  
  (defn foo [])
  
  (fn-name foo) ;; returns "foo"
  </code></pre>
  
  <p><strong>EDIT:</strong> With the provided hints I put together a basic macro that does what I want. Does it look better?</p>
  
  <pre><code>(defmacro fn-name
    [f]
    `(-&gt; ~f var meta :name str))
  </code></pre>