I'm a little upset that some of Clojure's built-in functions have what seems inconsistent to me.
I am trying to do this:
(let [kwns (namespace (keyword v))] ...)
in the context where v may be nil . The keyword function works as I expected (returns nil ), but the namespace throws away the NPE.
I got the impression that monads were not often used in Clojure, because nil-punning seems like an idiomatic form (as this article goes on for about).
I was expecting newbies to go zero and not throw NPE. When this inconsistency raises its ugly head, what is the recommended way to keep the code clean .... peppering nil checks my code - this is not the answer I want, of course.
source share