From 688d2230b93b03f2d4505346ef3b89b0f4c46445 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Mon, 11 Nov 2024 09:55:48 -0800 Subject: Allow C-style for loops --- chapter17/README.md | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'chapter17/README.md') diff --git a/chapter17/README.md b/chapter17/README.md index 95cc397e..b9733873 100644 --- a/chapter17/README.md +++ b/chapter17/README.md @@ -108,21 +108,39 @@ Allow `pred ? e_true : e_false`. Also allow `pred ? e_true`, where the false re is the zero type version of the true result. +## For Loops +Allow C/C++ style `for` loops: + +`for( init; test; next ) body` + +```cpp +int sum=0; +for( int i=0; i