summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-07-25 23:47:39 -0700
committerOri Bernstein <ori@eigenstate.org>2017-07-25 23:47:39 -0700
commitac23407c723cdcb12ddf4db973a10fd649f3c0ba (patch)
tree0335285c568b88dab2e2449071c03b2c027df215
parent710a12397e717608d3ae0886fd41aaa7dac8fb46 (diff)
downloadmc-ac23407c723cdcb12ddf4db973a10fd649f3c0ba.tar.gz
Update lang spec for new for syntax.
-rw-r--r--doc/lang.txt12
1 files changed, 6 insertions, 6 deletions
diff --git a/doc/lang.txt b/doc/lang.txt
index d71bb70..ca32c81 100644
--- a/doc/lang.txt
+++ b/doc/lang.txt
@@ -1909,7 +1909,7 @@ TABLE OF CONTENTS:
6.4. Looping
forstmt: foriter | foreach
- foreach: "for" pattern "in" expr "\n" block
+ foreach: "for" pattern ":" expr "\n" block
foriter: "for" init "\n" cond "\n" step "\n" block
whilestmt: "while" cond "\n" block
@@ -1926,12 +1926,12 @@ TABLE OF CONTENTS:
;;
The second form is the collection iteration form. This form allows
- for iterating over a collection of values contained within something
- which is iterable. Currently, only the built in sequences -- arrays
- and slices -- can be iterated, however, there is work going towards
- allowing user defined iterables.
+ for iterating over a collection of values contained within
+ something which is iterable. This form of loop can be used on any
+ iterable types. Iterable types are defined as slices, arrays, and any
+ type that implements the builtin iterable trait.
- for pat in expr
+ for pat : expr
blockbody()
;;