1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00

Update control_flow.md

This commit is contained in:
Thibaut Schaeffer 2021-06-22 15:45:59 +02:00 committed by GitHub
parent 6eea32a0fe
commit 961834c1ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -53,6 +53,8 @@ For loops are available with the following syntax:
The bounds have to be constant at compile-time, therefore they cannot depend on execution inputs. They can depend on generic parameters. The bounds have to be constant at compile-time, therefore they cannot depend on execution inputs. They can depend on generic parameters.
> For loops are only syntactic sugar for repeating a block of statements many times. No condition of the type `index < max` is being checked at run-time after each iteration. Instead, at compile-time, the index is incremented and the block is executed again. Therefore, assigning to the loop index does not have any influence on the number of iterations performed and is considered bad practice.
### Assertions ### Assertions
Any boolean can be asserted to be true using the `assert` function. Any boolean can be asserted to be true using the `assert` function.