Skip to content


Subversion checkout URL

You can clone with
Download ZIP


unable to get ns docstring if :main is set in project.clj (meta doc) #575

uvtc opened this Issue · 2 comments

2 participants


This is using lein 2.0.0-preview3.

If I create a new project (lein new foob) and --- touching nothing else --- add a namespace docstring to core.clj, making it look like this:

(ns foob.core
  "docstring for namespace")

then start a repl (lein repl), and do this:

user=> (require 'foob.core)
user=> (meta (the-ns 'foob.core))
{:doc "docstring for namespace"}

You can see I get that docstring.

(Side issue: I can't get the docstring in the usual way,

user=> (doc foob.core)
ClassNotFoundException foob.core$ (

but that may be related to

Now, if I go and add ":main foob.core" to my project.clj, then start the repl again:

foob.core=> (meta (the-ns 'foob.core))
foob.core=> (require 'foob.core)
foob.core=> (meta (the-ns 'foob.core))

That metadata appears to be missing.

If I now go back and remove the ":main foob.core" from project.clj (to get back to where I was), and restart the repl, I can't get that doc metadata back again. (!)

I get the same behaviour if I start over, but first change 1.3.0 to 1.4.0 in project.clj.


BTW, thanks to weavejester on irc for helping identify the issue(s)!


This is actually a bug in Clojure.

$ lein compile :all
java -cp `lein classpath` clojure.main -e "(prn (meta (the-ns (doto (quote foob.core) require))))"

The problem is that AOT causes namespaces to lose their metadata:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.