Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

First piece of hoc

  • Loading branch information...
commit 0a113317d05d659c1607cbac719dcc93d860b9c1 1 parent b7e931a
@fogus fogus authored
View
7 src/main/clojure/clojure/core/contracts.clj
@@ -12,6 +12,13 @@
{:docstring ~docstring
::constraints :TBD}))
+(defmacro _
+ [a b & body]
+ (let [name (if (symbol? a) a (gensym "hoc"))
+ args (if (symbol? a) b a)
+ body (if (symbol? a) body (list* b body))]
+ `(contract ~name "TBD" ~args ~(vec body))))
+
(defn with-constraints
"A contract combinator.
View
1  src/main/clojure/clojure/core/contracts/impl/transformers.clj
@@ -80,3 +80,4 @@
(->> cnstr-descrs
build-contract-bodies
(list* `fn name))))
+
Please sign in to comment.
Something went wrong with that request. Please try again.