Skip to content

Instantly share code, notes, and snippets.

@bluemont
Last active December 17, 2015 15: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 bluemont/43216ec4543115c29ee7 to your computer and use it in GitHub Desktop.
Save bluemont/43216ec4543115c29ee7 to your computer and use it in GitHub Desktop.
Is metadata a good idea here?
(ns my-lib.validation
"Validation functions"
(:refer-clojure :rename {keyword to-keyword}))
(defn keyword
"If key not nil, is value a keyword?"
[k v]
{:error "value must be a keyword when key is given"}
(if (nil? k) true
(keyword? v)))
; later, a `validate` function uses the :error metadata
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment