Clojure 1.13 adds support for checked keys(clojure.org)
213 points by FelipeCortez 4 days ago | 46 comments
tl;dr: Clojure 1.13.0-alpha1 introduces "checked keys" for map destructuring via new `:keys!`/`:syms!`/`:strs!` directives that throw if a required key is missing, plus support for listing unbound keys after `&` for documentation purposes. The release also bumps the PersistentArrayMap threshold from 8 to 64 for keyword-only maps (improving lookup performance), removes ACC_FINAL from static initializer constants to prepare for future JVM bytecode changes, and updates dependencies.
HN Discussion:
  • Checked keys make function interfaces self-documenting by distinguishing required from optional keys
  • Fail-fast errors are better than nil-punning propagating problems through the program
  • This feature goes against Clojure's nil-punning philosophy of pragmatic default behavior
  • This replaces common boilerplate assert checks and unreliable :pre conditions at function tops
  • Just another redundant way to validate function parameters among many existing options