Skip to content

Commit

Permalink
added a simple with-contracts macro that composes a string of contrac…
Browse files Browse the repository at this point in the history
…ts with a root contractee function
  • Loading branch information
Fogus committed Jun 4, 2010
1 parent f359c99 commit 2f03a99
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/fogus/me/trammel.clj
Expand Up @@ -25,6 +25,12 @@
(rest forms)
forms)))))

(defmacro with-contracts
([f] f)
([f contract] (list 'partial contract f))
([f contract & more]
`(with-contracts (with-contracts ~f ~contract) ~@more)))

(defmacro defconstrainedfn
[name & body]
(let [mdata (if (string? (first body))
Expand Down

0 comments on commit 2f03a99

Please sign in to comment.