How do i open a repl in a different namespace [duplicate]

时光怂恿深爱的人放手 提交于 2019-12-12 03:07:43

问题


Specifically with a leiningen uberjar.

java -cp myapp.jar clojure.main -r

gets me a repl but defaults to the user namespace What do I need to do to get it to myapp's namespace?

java -cp myapp.jar clojure.main -e (in-ns myapp.core)

gives me clojure.lang.LispReader$ReaderException

* Update * The ultimate goal is to simply run

java -jar myapp.jar

and have a Clojure REPL in my app's namespace. Every solution I've seen involves writing code on the command line that I want to put into my main method but can't seem to get running

(defn -main [&args]
  (clojure.main/main "-e" "(in-ns myapp.core)"))

completes/terminates immediately


回答1:


java -cp myapp.jar clojure.main -m myapp.core



来源:https://stackoverflow.com/questions/29311286/how-do-i-open-a-repl-in-a-different-namespace

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!