summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2012-08-12 17:13:58 -0400
committerOri Bernstein <ori@eigenstate.org>2012-08-12 17:13:58 -0400
commit73c6d49bb6ef0b41559f7acd5929accbb4697bc7 (patch)
tree9db38cc1db4ab7976d29985ca2d76143bef051d8 /doc
parent121f68645db7dd9e18ce34f502f70002b63c3a52 (diff)
downloadmc-73c6d49bb6ef0b41559f7acd5929accbb4697bc7.tar.gz
Improve formatting of 'examples' sections of docs.
Diffstat (limited to 'doc')
-rw-r--r--doc/lang.txt62
1 files changed, 35 insertions, 27 deletions
diff --git a/doc/lang.txt b/doc/lang.txt
index 5c90dd9..5d5f411 100644
--- a/doc/lang.txt
+++ b/doc/lang.txt
@@ -637,41 +637,49 @@ TABLE OF CONTENTS:
5.1. Hello World:
- use std
- const main = {
- std.put("Hello World!\n")
- -> 0
- }
+ use std
+ const main = {
+ std.put("Hello World!\n")
+ -> 0
+ }
+
+ TODO: DESCRIBE CONSTRUCTS.
5.2. Conditions
- const intmax = {a, b
- if a > b
- -> a
- else
- -> b
- ;;
- }
+ use std
+ const intmax = {a, b
+ if a > b
+ -> a
+ else
+ -> b
+ ;;
+ }
- const main = {
- var x = 123
- var y = 456
- std.put("The max of %i, %i is %i\n", x, y, max(x, y))
- }
+ const main = {
+ var x = 123
+ var y = 456
+ std.put("The max of %i, %i is %i\n", x, y, max(x, y))
+ }
+
+ TODO: DESCRIBE CONSTRUCTS.
5.3. Looping
- const innerprod = {a, b
- var i
- var sum
- for i = 0; i < a.len; i++
- sum += a[i]*b[i]
- ;;
- }
+ use std
+ const innerprod = {a, b
+ var i
+ var sum
+ for i = 0; i < a.len; i++
+ sum += a[i]*b[i]
+ ;;
+ }
+
+ const main = {
+ std.put("The inner product is %i\n", innerprod([1,2,3], [4,5,6]))
+ }
- const main = {
- std.put("The inner product is %i\n", innerprod([1,2,3], [4,5,6]))
- }
+ TODO: DESCRIBE CONSTRUCTS.
6. STYLE GUIDE: