From: Jérémie Astor Date: Sun, 6 Sep 2020 23:53:52 +0000 (+0200) Subject: :art: Update syntax X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=a6f21485e4d389e910d6f9e33c98119ba4fef4eb;p=gwion.git :art: Update syntax --- diff --git a/docs/Reference/ControlFlow/ForLoop.mdr b/docs/Reference/ControlFlow/ForLoop.mdr index 345bdf71..f1433185 100644 --- a/docs/Reference/ControlFlow/ForLoop.mdr +++ b/docs/Reference/ControlFlow/ForLoop.mdr @@ -36,9 +36,9 @@ for(int i; i < 3; ++i) { #### Simple auto loop @``` forloop4.gw int array[2][3]; -for(auto a: array) { +foreach(a: array) { <<< a >>>; - for(auto b: a) + foreach(b: a) <<< b >>>; } @``` @@ -50,12 +50,12 @@ If you want to change it the value in the array, you need a pointer @``` forloop5.gw int array[2][3]; int i; -for(auto a: array) { - for(auto ref b: a) +foreach(a: array) { + foreach(ref b: a) <<< ++i => *b >>>; } -for(auto a: array) { - for(auto ref b: a) +foreach(a: array) { + foreach(ref b: a) <<< *b >>>; } @```