Gotcha. I suppose that makes sense as long as I undo some poor design and make sure that the 'exit' wrapper I have never attempts to call System/exit directly and always throws some suitable exception for interpretation at the top level. Right now my exit wrapper calls exit immediately if we're not in a REPL environment. Very few applications would care about the distinction (including mine) between unwinding a thread then calling exit, vs calling exit without unwinding.
Independent of my exit situation, I can still think of situations in which people may want to perform logic only when it was known to be a REPL environment. Of course in the worst case you can always add a -D flag to the JVM on startup indicating some 'interactive" mode desires. I'm not sure how that goes with repls from cider in emacs and such. Meanwhile I'm set with a workaround, and the points made on (app) vs. (-main (app)) are good if you always throw and never call exit down the stack. On Thu, May 8, 2014 at 12:14 PM, Ray Miller <r...@1729.org.uk> wrote: > On 8 May 2014 16:22, Dave Tenny <dave.te...@gmail.com> wrote: > > James, All well and good, but you still need to know if you're running > in a > > REPL environment, and make sure you do NOT call System/exit for any > > (typical) reason in that environment. The idea is to test your (-main) > > function from the REPL, without having to restart the lisp every time. > > I think James's point was that, if your -main function is a thin > wrapper that calls (app ...), then it's (app ...) you'd test at the > REPL (apologies if I'm putting words into your mouth, James). > > Ray. > > -- > 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 a topic in the > Google Groups "Clojure" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/clojure/KZJQsmOeiHc/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- 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.