upvote
As a Clojurist the standard pattern for ensuring keys-are-set before doing-something is not-as-elegant-as-this. Clojure is full of macros that do useful things :) Simplifying oft-used patterns into compact representations is very on-brand. Plus, you need this like, all the time.

This will eliminate two whole classes of errors: 1) where keys are supplied a value at an undesired nesting-level. 2) where keys are not-yet-set for some other reason.

For the many programmers who have to write in checks and verifications themselves for this, this saves quite a bit of time, removing the interruption from coding and restoring the flow of getting logic-to-symbol.

reply
The maps are still open to new keys even if some keys are checked. I think that fits in with how clojure.spec and Malli work already, but in a lighter syntax.
reply
The maps haven't changed at all, this is a feature at destructuring sites.
reply
Sorry if I wasn’t clear, I was referring to the maps that are being destructured.
reply
Seems additive to me; no breaking changes, and better control and error messages when opting in for it, seems entirely Clojurely to me.
reply
It's 100% opt-in at the call site and doesn't affect existing code, so no?

Many people (including myself) already have checked key variants for maps; this mainly extends the syntax to destructuring too.

reply
Howso?
reply