Trammel

a contracts-programming library for Clojure

Contracts Programming

the relationship between a class and its clients as a formal agreement, expressing each party's rights and obligations

read more

The contract macro is the lowest level construct provided by Trammel, but it is not likely to be broadly useful given that it defines anonymous contracts. However, you might find the defcontract macro much more agreeable, especially in concert with with-constraints and provide-contracts:

(defcontract sqr-contract
  "Defines the constraints for squaring"
  [n] [number? (not= 0 n) => pos? number?])

return to documentation

clojars → source code → tickets → wiki →