Skip to content

Commit

Permalink
Put normative part before example, and rewrite last sentence.
Browse files Browse the repository at this point in the history
  • Loading branch information
HansOlsson committed Dec 13, 2022
1 parent bfd81fa commit 56f68b6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions chapters/statements.tex
Expand Up @@ -202,8 +202,9 @@ \subsubsection{Implicit Iteration Ranges}\label{implicit-iteration-ranges}
An iterator \lstinline!IDENT in range-expr! without the \lstinline!in range-expr! requires that the \lstinline!IDENT! appears as the subscript of one or several subscripted expressions, where the expressions are not part of an array in a component of an expandable connector.
The dimension size of the array expression in the indexed position is used to deduce the \lstinline!range-expr! as \lstinline!1:size(array-expression,indexpos)! if the indices are a subtype of \lstinline!Integer!, or as \lstinline!E.e1:E.en! if the indices are of an enumeration type \lstinline!E = enumeration(e1, $\ldots$, en)!, or as \lstinline!false:true! if the indices are of type \lstinline!Boolean!.
If it is used to subscript several expressions, their ranges must be identical.
The \lstinline!IDENT! may also, inside a reduction expression, array constructor expression, \lstinline!for!-statement, or \lstinline!for!-equation, occur freely outside of subscript positions, but only as a reference to the variable \lstinline!IDENT!, and not for deducing ranges.
There may not be assignments to the entire arrays that are subscripted with \lstinline!IDENT! inside the loop, but there may be assignments to individual elements or ranges of elements.

The \lstinline!IDENT! may also, inside a reduction expression, array constructor expression, \lstinline!for!-statement, or \lstinline!for!-equation, occur freely outside of subscript positions, but only as a reference to the variable \lstinline!IDENT!, and not for deducing ranges.
The \lstinline!IDENT! may also be used as a subscript for an array in a component of an expandable connector but it is only seen as a reference to the variable \lstinline!IDENT! and cannot be used for deducing ranges.

\begin{example}
Expand Down Expand Up @@ -232,8 +233,7 @@ \subsubsection{Implicit Iteration Ranges}\label{implicit-iteration-ranges}
\end{lstlisting}
\end{example}

There may not be assignments to the entire array inside the loop, but there may be assignments to individual elements or ranges of elements.
The size of an array -- the iteration range -- is evaluated on entry to the \lstinline!for!-loop and the array size will thus not change during the execution of the \lstinline!for!-loop.
The size of an array -- the iteration range -- can be evaluated on entry to the \lstinline!for!-loop, since the array size cannot change during the execution of the \lstinline!for!-loop.

\subsubsection{Types as Iteration Ranges}\label{types-as-iteration-ranges}

Expand Down

0 comments on commit 56f68b6

Please sign in to comment.