speced.def icon indicating copy to clipboard operation
speced.def copied to clipboard

Implement a ^::speced/closed-keys directive

Open vemv opened this issue 5 years ago • 0 comments

Given

(speced/defn
  inline-function
  [^::speced/closed-keys {:keys [foo bar baz] :as x}]
  (when (< 0 x 100)
    (-> x (* x) str)))

, ^::speced/closed-keys would ensure that the map x only has the destructured keys, without extra ones.

The directive should be non-recursive, and if possible the :as destructuring should be used, for clearer error reports (vs. gensym)

vemv avatar Mar 20 '19 14:03 vemv