Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Break up code fragments

  • Loading branch information...
commit 9627422225605a1a795c861d3fff5441d9f22552 1 parent 1d62df9
Fogus fogus authored
Showing with 15 additions and 4 deletions.
  1. +15 −4 docs/index.org
19 docs/index.org
View
@@ -2,13 +2,16 @@
#+AUTHOR: Fogus
#+STYLE: <link rel="stylesheet" type="text/css" href="styles/default.css" />
-
#+INCLUDE: header.org org
-
#+begin_src clojure
-(require '[clojure.core.contracts :as contracts])
+(ns my.awesome.lib
+ (require
+ [clojure.core.contracts :as contracts]))
+#+end_src
+#+name: simple-example
+#+begin_src clojure :tangle ../examples/simple.clj :noweb yes
(defn sqr [n] (* n n))
(sqr 10)
@@ -16,11 +19,20 @@
(sqr 0)
;=> 0
+#+end_src
+
+
+#+name: simple-example
+#+begin_src clojure :tangle ../examples/simple.clj :noweb yes
(contracts/provide
(sqr "Constraints for squaring"
[x] [number? (not= 0 x) => number? pos?]))
+#+end_src
+
+
+#+begin_src clojure
(sqr 10)
;=> 100
@@ -30,5 +42,4 @@
#+end_src
-
#+INCLUDE: footer.org org
Please sign in to comment.
Something went wrong with that request. Please try again.