In the Phil Hagelberg gripes file, he claims the following about Clojure:
nil everywhere and causes errors that are hard to find source
Now Phil is a smart guy who has made a big contribution to the Clojure community and everyone uses his stuff, so I thought it was worth considering for a moment.
One easy way to control nil args functions is to throw an error:
(defn myfunc [myarg1] (when (nil? myarg1) (throw (Exception. "nil arg for myfunc"))) (prn "done!"))
These two additional lines for the argument reflect the pattern. Is there an idiomatic way to remove them using metadata or macros?
My question is, is there a quick way to test Clojure function for nil args?
null clojure
hawkeye
source share