shithub: mc

Download patch

ref: ac23407c723cdcb12ddf4db973a10fd649f3c0ba
parent: 710a12397e717608d3ae0886fd41aaa7dac8fb46
author: Ori Bernstein <ori@eigenstate.org>
date: Tue Jul 25 19:47:39 EDT 2017

Update lang spec for new for syntax.

--- a/doc/lang.txt
+++ b/doc/lang.txt
@@ -1909,7 +1909,7 @@
     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 @@
             ;;
 
         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()
             ;;