Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Exception on "lein repl" with :main in project.clj and undef'd fn call in -main #106

Closed
jafingerhut opened this Issue Mar 23, 2013 · 1 comment

Comments

Projects
None yet
2 participants
Contributor

jafingerhut commented Mar 23, 2013

Issue created at request of Colin Jones after posting message below to Leiningen email list.

Details of version numbers of things that I'm using below, in case it makes a difference. I have boiled this down to what is probably a minimal test case, after experiencing the behavior in a somewhat larger project.

% lein new weirdfail
% cd weirdfail

Add line ":main weirdfail.core" to project.clj
Edit src/weirdfail/core.clj so it has this function at the end. It is important that "bar" is not defined anywhere.

(defn -main [& args]
  (bar))

When I run "lein repl", I get this:

% lein repl
nREPL server started on port 58404
CompilerException java.lang.RuntimeException: Unable to resolve symbol: defmacro in this context, compiling:(NO_SOURCE_PATH:1:5)
reply.eval-modes.nrepl=>

If I do any one of the following changes by itself, I can do "lein repl" and things start up normally:

  • Remove ":main weirdfail.core" line from project.clj
  • Remove (bar) from -main, or change it to a call to (foo), which is defined earlier in the file.

Environment: Mac OS X 10.8.3
% lein version
Leiningen 2.1.1 on Java 1.7.0_15 Java HotSpot(TM) 64-Bit Server VM

Owner

trptcolin commented Mar 23, 2013

OK, this should be all set, mostly by the lein commit, actually. And the reply commit should prevent these annoying reply.eval-modes.nrepl=> starting-ns problems after an initialization failure, falling back to the user ns.

Thanks for reporting this, and let me know if you come across any other annoyances.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment