News for hackers. Stuff that matters.
Re:A History of Clojure [pdf] by raspasov on Thursday June 04, 2020 @10:04PM (#23424277)
What you're talking about is effectively a type-hint. Clojure supports those like:

(defn get-row-by-id [^Number id] ...) (defn get-row-by-user-name [^String s] ...)

There's also destructuring which both "extracts" local variables from data structures and serves as an informal documentation/description of the data shape.

You can combine type-hints and destructuring for a very powerful effect. Nowadays, I almost never have a problem "remembering" what or what shape of data I need to pass around.

There are no comments on this comment yet.