Skip to content

Instantly share code, notes, and snippets.

@kryft
Created January 24, 2015 15:47
Show Gist options
  • Save kryft/b4e3984dc18fbe6b5fad to your computer and use it in GitHub Desktop.
Save kryft/b4e3984dc18fbe6b5fad to your computer and use it in GitHub Desktop.
Two fn expressions with the same name
(sc/defschema NonNegInt
"Schema for a non-negative integer."
(sc/both
sc/Int
(sc/pred (fn is-positive [key] (>= key 0)))))
(sc/defschema PosInt
"Schema for a positive integer."
(sc/both
sc/Int
(sc/pred (fn is-positive [key] (> key 0)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment