Skip to content

Instantly share code, notes, and snippets.

@MichaelDrogalis
Created September 9, 2013 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MichaelDrogalis/6500824 to your computer and use it in GitHub Desktop.
Save MichaelDrogalis/6500824 to your computer and use it in GitHub Desktop.
(ns example.core
(:require [dire.core :refer :all]))
(defn f [x]
(keys x))
(f {:a 1 :b 2}) ;=> ok
(with-precondition! #'f
:enforce-keys
(fn [x]
(not (contains? x :c))))
(f {:a 1 :b 2 :c 3}) ; => throw ex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment