Search code examples
clojurevimclojure

Some functions don't show up when running a REPL via nailgun server


I am trying to use appengine-magic (0.3.1) setup with VimClojure (2.2.0) and Clojure 1.2.0.

Things look right when used via vanilla REPL (lein repl).

user=> (require '[clojure.contrib.ns-utils :as nsu])
nil
user=> (require '[appengine-magic.core :as ae])
nil
user=> (nsu/ns-vars 'appengine-magic.core)
(appengine-environment-type def-appengine-app
 default-war-root in-appengine-interactive-mode? open-resource-stream
 start start* stop stop* wrap-war-static)

But when the same code is sent from VimClojure to nailgun server:

java -cp "`lein classpath`" vimclojure.nailgun.NGServer 127.0.0.1

Some functions and macros disappear.

user=> (require '[clojure.contrib.ns-utils :as nsu])
nil
user=> (require '[appengine-magic.core :as ae])
nil
user=> (nsu/ns-vars 'appengine-magic.core)
(appengine-environment-type def-appengine-app
 in-appengine-interactive-mode? open-resource-stream)

The same version of appengine-magic jar is definitely in the classpath.

So, is it a bug or misconfiguration?


Solution

  • It looks more like a feature to me.

    Check out the last form in https://github.com/gcv/appengine-magic/blob/master/src/appengine_magic/core.clj. The fns loaded up in that namespace are precisely dependent on whether you're running Swank or the normal REPL.

    I can't speak to why that is, but it's clearly the intended behavior of appengine-magic.