Hacker News new | ask | show | jobs
by ataggart 4358 days 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)))
1 comments

Furthermore, 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.