Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added a fn useful for determining if a symbol points to a constraint …

…(i.e. a curried function created by core.contracts
  • Loading branch information...
commit fc6b92fbb9e061f105cb90092934aba1608e1945 1 parent a7b27c6
@fogus fogus authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/main/clojure/clojure/core/contracts/impl/utils.clj
View
10 src/main/clojure/clojure/core/contracts/impl/utils.clj
@@ -53,6 +53,16 @@
(~v l# r#))))
(cons `do)))
+(defn constraint?
+ "Determines if a symbol represents a
+ core.contracts constraint."
+ [sym]
+ (-> sym
+ resolve
+ meta
+ :clojure.core.contracts/original
+ boolean))
+
(comment
(macroexpand
'(defcurry-from clojure.core
Please sign in to comment.
Something went wrong with that request. Please try again.