Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions gazprea/spec/expressions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,11 @@ instance:

This is true for domain expressions within generators as well.

Iterator variables can be assigned to and re-declared within the enclosed iterator loop.
The variable is re-initialized according to the expression each iteration.
An iterator variable is a fresh *constant* binding in each iteration:
assigning to it is an error, but a declaration inside the loop body may
shadow it, exactly as in any other nested scope. The shadowing declaration
does not affect the iteration; the iterator is re-bound from the domain at
the start of each iteration.

::

Expand Down
6 changes: 4 additions & 2 deletions gazprea/spec/statements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,10 @@ Array ranges can also be used instead:
i -> std_output;
}

The domain is evaluated once during the first iteration of the loop. Each iteration
defines a constant domain variable from it's respective index. For instance:
The domain is evaluated once during the first iteration of the loop. Each
iteration defines a constant domain variable from its respective index;
the variable cannot be assigned to, though it may be shadowed by an inner
declaration (see :ref:`ssec:expressions_dom_expr`). For instance:

::

Expand Down
Loading