> Throwing java.lang.Exception if a condition is not meat in your clojure functions? Don't do this either!!!
What's the proper way of doing that in clojure ?
-way- is not the problem here. The java.lang.Exception is. :-)
Throw specialized "Runtime Exceptions" would be the way to go. For example throw IllegalArgumentException runtime exception if function call receives inappropriate arguments.
You can also define your own specific (app-level) exception by proxying the RuntimeException or other relevant using the clojure's proxy macro.
The way your parens should flow:
The author doesn't take an idiomatic approach to programming in Clojure in most of his code snippets.[edit]
Throwing java.lang.Exception if a condition is not meat in your clojure functions? Don't do this either!!!