I am a beginner with Clojure and making my way through Higginbotham’s CftBT. Here is my newbie question. Suppose I have a function like this
(defn myfunc [input-map] (input-map :important-key))
how would I annotate that parameter
input-map should be a
map that contains a key
If it is relevant to the answer, by “annotate” I mean some kind of code decoration so that I can automatically generate (from my code) HTML documentation that will tell the reader that the
input-map parameter to
myfunc is expected to be a
map containing the key
:important-key. For my purposes, if this annotation also helps with avoiding run-time bugs (such as a parameter of the wrong type being passed) that is a bonus. For my present purposes, I’m not worried about performance so much (avoiding reflection, etc.) as I am still just learning.
Thanks for your help.