Permalink
Browse files

Export from org mode to wiki-markdown

  • Loading branch information...
1 parent 261166d commit c97979e18a9ab7c71de1df8fdec58195890a25cf @fogus fogus committed Mar 11, 2013
Showing with 16 additions and 16 deletions.
  1. +10 −11 docs/contract.org
  2. +5 −3 docs/provide.org
  3. +1 −2 docs/references.org
View
@@ -1,8 +1,6 @@
----
-title: Trammel - Isolated Unnamed Contracts
----
+* contract
-As you saw in the description of [`defconstrainedfn`](../defconstrainedfn/) Trammel allows you to create functions with a localized and dependent contract. However, there may be circumstances where the separation of contract and constrained function is preferred. Take for example, a simple `slope` function:
+As you saw in the description of [[./defconstrainedfn][defconstrainedfn]] core.contracts allows you to create functions with a localized and dependent contract. However, there may be circumstances where the separation of contract and constrained function is preferred. Take for example, a simple ~slope~ function:
<div class="gist">
<div class="gist-file">
@@ -26,7 +24,7 @@ Defining a separate contract for this function is a simple matter:
</div>
</div>
-We can then define a constrained version of `sqr` using Trammel's [`with-constraints`](../with-constraints/) macro:
+We can then define a constrained version of ~sqr~ using core.contracts's [[../with-constraints/][with-constraints]] macro:
<div class="gist">
<div class="gist-file">
@@ -38,7 +36,7 @@ We can then define a constrained version of `sqr` using Trammel's [`with-constra
</div>
</div>
-However, this constraint definition for `sqr`, while accurate, is very broad. In fact, the software team developing software for the 8-bit Atari console would not be able to use `constrained-sqr` as it is far too liberal. Therefore, they can define their own contract that further constrains `constrained-sqr`:
+However, this constraint definition for ~sqr~, while accurate, is very broad. In fact, the software team developing software for the 8-bit Atari console would not be able to use ~constrained-sqr~ as it is far too liberal. Therefore, they can define their own contract that further constrains ~constrained-sqr~:
<div class="gist">
<div class="gist-file">
@@ -62,10 +60,10 @@ And all appears to be in order -- except:
</div>
</div>
-That is, calling the function `sqr-8bit` with `100` causes a *post-condition* failure! The reason for this is because the underlying `sqr` is the same old arbitrary-precision version when what we really want is a function that deals in only 8-bit values. There are two possible ways to do this:
+That is, calling the function ~sqr-8bit~ with ~100~ causes a *post-condition* failure! The reason for this is because the underlying ~sqr~ is the same old arbitrary-precision version when what we really want is a function that deals in only 8-bit values. There are two possible ways to do this:
-1. Create a version of `sqr-8bit` that does in fact deal in 8-bit values
-2. Tighten the constraint on `constrained-sqr` further by applying another contract
+1. Create a version of ~sqr-8bit~ that does in fact deal in 8-bit values
+2. Tighten the constraint on ~constrained-sqr~ further by applying another contract
<div class="gist">
<div class="gist-file">
@@ -77,6 +75,7 @@ That is, calling the function `sqr-8bit` with `100` causes a *post-condition* fa
</div>
</div>
-Using `contract` and `with-constraints` you were able to tighten the constraints on both the pre- and post-conditions of the `sqr` function. However, what if you wanted to relax the requirements? Stay tuned.
+Using ~contract~ and ~with-constraints~ you were able to tighten the constraints on both the pre- and post-conditions of the ~sqr~ function. However, what if you wanted to relax the requirements? Stay tuned.
+
+[[../docs.html][return to documentation]]
-[return to documentation](../docs.html)
View
@@ -1,3 +1,5 @@
+* provide
+
While defining contracts local to the constrained function is nice (see [[../defconstrainedfn/][defconstrainedfn]] for more information), very often you will find yourself in possession of an existing function that is not constrained:
<div class="gist">
@@ -10,7 +12,7 @@ While defining contracts local to the constrained function is nice (see [[../def
</div>
</div>
-In this case, Trammel provides the `provide-contracts` macro to define contracts and apply them dynamically to existing functions:
+In this case, core.contracts provides the ~provide-contracts~ macro to define contracts and apply them dynamically to existing functions:
<div class="gist">
<div class="gist-file">
@@ -22,7 +24,7 @@ In this case, Trammel provides the `provide-contracts` macro to define contracts
</div>
</div>
-As shown, the `sqr` function is dynamically modified with the contract defined in the body of `provide-contracts`. This macro can take any number of vectors where each corresponds to a contract for a given function; including multiple arities embedded within. Trammel also allows you to include existing *named* contracts (see [`defcontract`](../defcontract/) for more information) instead of the contract specification vector, as shown below:
+As shown, the ~sqr~ function is dynamically modified with the contract defined in the body of ~provide-contracts~. This macro can take any number of vectors where each corresponds to a contract for a given function; including multiple arities embedded within. core.contracts also allows you to include existing *named* contracts (see [[./defcontract/][defcontract]] for more information) instead of the contract specification vector, as shown below:
<div class="gist">
<div class="gist-file">
@@ -34,7 +36,7 @@ As shown, the `sqr` function is dynamically modified with the contract defined i
</div>
</div>
-`provide-contracts` gives you a lot of flexibilty in how to separate functions from their contracts and likewise apply them in domain-specific ways.
+~provide-contracts~ gives you a lot of flexibilty in how to separate functions from their contracts and likewise apply them in domain-specific ways.
[[../docs.html][return to documentation]]
View
@@ -1,5 +1,4 @@
-clojure.core.contracts references
-=================================
+* clojure.core.contracts references
- *[A Proof Engine for Eiffel](http://tecomp.sourceforge.net/index.php?file=doc/papers/proof/engine)*
- *[An Axiomatic Basis for Computer Programming](http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.116.2392)* by C.A.R Hoare -- essential reading

0 comments on commit c97979e

Please sign in to comment.