From 1d079fc574a35f39fd52e3de23a1c8bfa45238ae Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 8 Mar 2016 16:50:22 -0800 Subject: 2742 --- Readme.md | 43 ++----------------------------------------- html/fork.png | Bin 0 -> 19933 bytes html/tangle.png | Bin 0 -> 42367 bytes 3 files changed, 2 insertions(+), 41 deletions(-) create mode 100644 html/fork.png create mode 100644 html/tangle.png 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 - { - - } - - ] - - after [ - # if n=0 return 1 - zero?:boolean <- equal n, 0 - break-unless zero? - return 1 - ] - - after [ - # return n * factorial(n-1) - x:number <- subtract n, 1 - subresult:number <- factorial x - result:number <- multiply subresult, n - return result - ] - ``` +literate programming (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 - } - ] - ``` +forking concurrent routines ```shell $ ./mu fork.mu diff --git a/html/fork.png b/html/fork.png new file mode 100644 index 00000000..f7bfcf5c Binary files /dev/null and b/html/fork.png differ diff --git a/html/tangle.png b/html/tangle.png new file mode 100644 index 00000000..beda9eb0 Binary files /dev/null and b/html/tangle.png differ -- cgit 1.4.1-2-gfad0