• (provide-contracts & contracts)

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source fogus/me/trammel.clj:190 top

(defmacro provide-contracts [& contracts]
  (let [fn-names  (map first contracts)
        contracts (for [[n ds & more] contracts] 
                    (if (vector? (first more)) 
                      (list* `contract n ds more) 
                      (first more)))]
      ~@(for [[n# c#] (zipmap fn-names contracts)]
          (list `alter-var-root (list `var n#) 
                (list `fn '[f c] (list `with-constraints 'f 'c)) c#))
Vars in defmacro for let list alter-var-root concat fn seq
Used in 0 other vars

Comments top

No comments for provide-contracts. Log in to add a comment.