philipbohun.com

Glojure by Example: Exit

os.Exit stops the process with a status code. Deferred work does not run, and expressions after the call do not run. Exit is immediate.

(println "goodbye")
(os.Exit 3)
(println "not printed")

The status is 3. echo $? prints it in a shell.

$ glj exit.glj
goodbye
$ echo $?
3

Next example: Reader Conditionals.