Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6956659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:53:54+00:00 2026-05-27T14:53:54+00:00

Like so: java -cp clojure.jar clojure.main Clojure 1.2.0 user=> (defn f [x] x) #’user/f

  • 0

Like so:

java -cp clojure.jar clojure.main
Clojure 1.2.0
user=> (defn f [x] x)
#'user/f
user=> (meta f)
{:ns #<Namespace user>, :name f}
user=> (defn f [x] x)
#'user/f
user=> (meta f)
{:ns #<Namespace user>, :name f, :file "NO_SOURCE_PATH", :line 1, :arglists ([x])}
user=> 

Why doesn’t the call to meta return the same value each time?

UPDATE: by playing some more I was able to get an answer to my immediate question. defn macro-expands to a form which adds (meta (var f) to f‘s metadata. And (meta (var f) includes the extra info that isn’t in (meta f) when f is defined the first time. So my question now becomes, why is defn implemented like this?

java -cp clojure.jar clojure.main
Clojure 1.2.0
user=> (defn f [x] x)
#'user/f
user=> (meta f)
{:ns #<Namespace user>, :name f}
user=> (meta (var f))
{:ns #<Namespace user>, :name f, :file "NO_SOURCE_PATH", :line 1, :arglists ([x])}
user=> (macroexpand '(defn f [x] x))
(def f (.withMeta (clojure.core/fn f ([x] x)) (.meta (var f)))) ; (.meta x) seems to be the same as (meta x)
user=> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:53:55+00:00Added an answer on May 27, 2026 at 2:53 pm

    Apparently this behaviour was more or less “accidental” in Clojure 1.2, and has been changed in 1.3:
    http://groups.google.com/group/clojure/browse_thread/thread/964bba0ead8218ee/3ef0c841474c85f4?lnk=gst&q=function+meta+data#3ef0c841474c85f4

    In 1.3, only the Var includes the metadata – the function itself isn’t assigned any metadata by defn.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

java -cp clojure.jar clojure.main compile.clj this is compiling the clojure code. javac CalculateSum.java compiling
I have recently started seeing user agents like Java/1.6.0_14 (and variations) on my site
I'm creating a library that includes both Clojure and Java code, and would like
I read somewhere Clojure is compiled. Is it really compiled, like Java or Scala,
I'm trying to write a Clojure layer around a Java API that looks like
I would like to create/drop a database from clojure.java.jdbc. This fails: (require '[clojure.java.jdbc :as
I have a sql exception from clojure that goes like this: java.lang.Exception: transaction rolled
I would like to cast a clojure Java object (assigned with let*) to another
I'd like to wrap java's PriorityQueue class in clojure for use in another part
In languages like Java and C#, strings are immutable and it can be computationally

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.