about summary refs log tree commit diff stats
path: root/Readme.md
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-03-08 16:50:22 -0800
committerKartik K. Agaram <vc@akkartik.com>2016-03-08 16:50:22 -0800
commit1d079fc574a35f39fd52e3de23a1c8bfa45238ae (patch)
treee64f2775b4a757183a1279265ec3b9812571120c /Readme.md
parentf7d4db3408cfcc0a027266435e4ac54a0828c8cb (diff)
downloadmu-1d079fc574a35f39fd52e3de23a1c8bfa45238ae.tar.gz
2742
Diffstat (limited to 'Readme.md')
-rw-r--r--Readme.md43
1 files changed, 2 insertions, 41 deletions
diff --git a/Readme.md b/Readme.md
index c47ef1cd..64124181 100644
--- a/Readme.md
+++ b/Readme.md
@@ -443,31 +443,7 @@ something like this:
 An alternative way to define factorial is by inserting *labels* and later
 inserting code at them.
 
-  ```nim
-  def factorial [
-    local-scope
-    n:number <- next-ingredient
-    {
-      <base-case>
-    }
-    <recursive-case>
-  ]
-
-  after <base-case> [
-    # if n=0 return 1
-    zero?:boolean <- equal n, 0
-    break-unless zero?
-    return 1
-  ]
-
-  after <recursive-case> [
-    # return n * factorial(n-1)
-    x:number <- subtract n, 1
-    subresult:number <- factorial x
-    result:number <- multiply subresult, n
-    return result
-  ]
-  ```
+<img alt='literate programming' src='html/tangle.png'>
 
 (You'll find this version in `tangle.mu`.)
 
@@ -480,22 +456,7 @@ names for inserting code at.
 
 Another example, this time with concurrency.
 
-  ```
-  def main [
-    start-running thread2
-    {
-      $print 34
-      loop
-    }
-  ]
-
-  def thread2 [
-    {
-      $print 35
-      loop
-    }
-  ]
-  ```
+<img alt='forking concurrent routines' src='html/fork.png'>
 
   ```shell
   $ ./mu fork.mu