tags:

views:

284

answers:

2

Hi, I am a pretty decent programmer in Java, however I am new to programming in Clojure.

My question is : In java, to force an exit in the program, the code is :System.exit(0) ..........Is there any equivalent to this code is Clojure?

-Thank you

+5  A: 

Given that part of the attractiveness of Clojure is that you can use Java class libraries, why not just do:

(System/exit 0)
Pavel Minaev
Thanks! Works perfectly
Beat me too it!
Rayne
+1  A: 

For a more complete reference: you call any java classes static methods by specifying

    (my.package.class/staticMethodName arg1 arg2 etc)

java.lang.* is loaded automagically for you already though if it where not you could call it with

  (java.lang.System/exit 0)
Arthur Ulfeldt