On Feb 27, 2015, at 12:09 AM, Cecil Westerhof <cldwester...@gmail.com> wrote:
> In my application I have a quit button which does:
>     (System/exit 0)
> 
> But when I used 'lein repl' I do not want to exit, but just close the frame. 
> Can this be done?

Here’s how we do it. Add the following to project.clj:

  :profiles {:repl {:jvm-opts ~(conj (jvm-opts) "-Dlein.profile.repl=true")}}

jvm-opts is a function in project.clj that returns the default JVM options — we 
do different things on different platforms — it returns a vector of JVM 
options. So :jvm-opts ["-Dlein.profile.repl=true"] might be sufficient for you.

Then in our code we test:

        (System/getProperty "lein.profile.repl")

This will be true if you’re in a REPL and nil otherwise.

Sean Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)



-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to