summaryrefslogtreecommitdiff log msg author committer range
path: root/doc/lang.txt
diff options
 context: 12345678910152025303540 space: includeignore mode: unifiedssdiffstat only
Diffstat (limited to 'doc/lang.txt')
-rw-r--r--doc/lang.txt62
1 files changed, 35 insertions, 27 deletions
 diff --git a/doc/lang.txt b/doc/lang.txtindex 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: