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

Merge pull request #924 from Zokrates/for-loop-doc

Update for loop doc
This commit is contained in:
Thibaut Schaeffer 2021-06-26 15:52:02 +02:00 committed by GitHub
commit 1b4b88b150
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View file

@ -0,0 +1 @@
Add details to for-loop documentation

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.
> 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
Any boolean can be asserted to be true using the `assert` function.