Take the 2-minute tour ×

why does (clojure.repl/source in-ns) not work while (doc in-ns) gives the documentation? I even tried to change my namespace into clojure.core but did not help ... Can somebody tell me why this is happening..?

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

Interestingly, there is no source link for in-ns function in online documentation and I couldn't find this function in core.clj on github either.

It seems that this particular function was hardcoded in Java beneath clojure implementation.

See this link: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java

and this piece of code is your in-ns:

final static IFn inNamespace = new AFn(){
 public Object invoke(Object arg1) throws Exception{
  Symbol nsname = (Symbol) arg1;
  Namespace ns = Namespace.findOrCreate(nsname);
  return ns;
share|improve this answer
Yes, in-ns is a special form implemented directly in the compiler. –  Stuart Sierra Nov 21 '10 at 15:49
add comment

Your Answer


