Permalink
Browse files

Adding with-constraints from old trammel version

  • Loading branch information...
1 parent 1ada1da commit fae4025a43ba1a35c1866ed426b478b042ac21d8 @fogus fogus committed Jan 22, 2013
Showing with 19 additions and 0 deletions.
  1. +19 −0 docs/with-constraints.org
View
@@ -0,0 +1,19 @@
+---
+title: Trammel - Applying Contracts Manually
+---
+
+Trammel's `with-constraints` macro takes a function followed by one or more contracts and returns a new function that is the amalgamation of them all:
+
+<div class="gist">
+ <div class="gist-file">
+ <div class="gist-data gist-syntax">
+ <div class="gist-highlight">
+<pre><div class="line" id="LC1"><span class="p">(</span><span class="k">def </span><span class="nv">constrained-sqr</span> </div><div class="line" id="LC2">&nbsp;&nbsp;<span class="p">(</span><span class="nf">with-constraints</span></div><div class="line" id="LC3">&nbsp;&nbsp;&nbsp;&nbsp;<span class="nv">sqr</span></div><div class="line" id="LC4">&nbsp;&nbsp;&nbsp;&nbsp;<span class="nv">sqr-contract</span><span class="p">))</span></div></pre>
+ </div>
+ </div>
+ </div>
+</div>
+
+See the docs of [`contract`](../contract/) for more detail.
+
+[return to documentation](../docs.html)

0 comments on commit fae4025

Please sign in to comment.