70388

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

Question:

This question already has an answer here:

<ul><li> <a href="/questions/8306157/how-do-i-start-the-repl-in-a-user-defined-namespace" dir="ltr" rel="nofollow">How do I start the REPL in a user defined namespace?</a> <span class="question-originals-answer-count"> 6 answers </span> </li> </ul>

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

<strong>* Update *</strong> 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

Answer1:

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

Recommend

  • Priority queue for Common Lisp?
  • Spark Installation and Configuration on MacOS ImportError: No module named pyspark
  • Scala call-by-name constructor parameter in implicit class
  • Sending message to Clojure application from terminal
  • Any merit to a lazy-ish juxt function?
  • Conque SML backspace
  • 'Could not find us.bpsm:edn-java:0.4.3' error with Gradle for Clojure (Clojuresque)
  • Word 2007 VBA: ActiveDocument.CustomXMLParts
  • How to preserve alias property while signing app?
  • Clojure embed var to String, a alternative way? Like sprintf way?
  • ActionBar with appcompat library v7 (ava.lang.IllegalStateException: You need to use a Theme.AppComp
  • Does Julia have something equivalent to Ans (Matlab) or Last.value (R)
  • angularjs - ng-show doesn't update class when $interval triggers
  • stringify/parse edn in clojure/ClojureScript
  • docker-compose: connection refused between containers, but service accessible from host
  • Locating unmatched delimiters in Clojurescript
  • GWT Widget.addHandler
  • Sending Content-Type application/x-www-form-urlencoded WSO2 ESB
  • integrate POCO library in android ndk
  • Why are “sc.addFile” and “spark-submit --files” not distributing a local file to all workers?
  • “mvn clean generate-source” could not resolve dependencies
  • In Java, how can I construct a File from a resource?
  • Android Database Error - getWriteableDatabase
  • CERN ROOT exporting data to plain text
  • OSX - always hide certain files
  • Android Studio Can't Find tools.jar
  • Angular2 component view does not update on value change via method
  • CakePHP ACL tutorial initDB function warnings
  • Jetty 9 HashLoginService
  • Cancel a live stream “fast motion” catch-up in Flash
  • Display issues when we change from one jquery mobile page to another in firefox
  • output of program is not same as passed argument
  • Python - Map / Reduce - How do I read JSON specific field in using DISCO count words example
  • Akka Routing: Reply's send to router ends up as dead letters
  • Hibernate gives error error as “Access to DialectResolutionInfo cannot be null when 'hibernate.
  • SetUp method failed while running tests from teamcity
  • Understanding cpu registers
  • coudnt use logback because of log4j
  • unknown Exception android
  • Checking variable from a different class in C#