5 ms·
Correctness can often arise naturally when the implementation reflects the function's intent by composing "correct" functions. E.g., (defn values-in [m ks]
by ataggart 12y ago
Correctness can often arise naturally when the implementation reflects the function's intent by composing "correct" functions. E.g.,
(defn values-in [m ks]
(vals (select-keys m ks)))
- dkersten 12y agoFurthermore, I've found that absent keys degrading to nil is actually a very useful feature that makes a lot of code really composable and simple. I can't think of any Clojure code I've written recently where a value of nil actually should be distinguished from an absent value - I just write my code so that semantically they mean the same thing, because this makes the code much easier to compose and much easier to think about.