Skip to content

Commit

Permalink
And also for for-loops.
Browse files Browse the repository at this point in the history
  • Loading branch information
HansOlsson committed Apr 5, 2023
1 parent 7059416 commit d6176e3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions chapters/statements.tex
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ \subsection{For-Statement}\label{for-statement}
\end{lstlisting}
The rules for \lstinline!for!-statements are the same as for \lstinline!for!-expressions in \cref{explicit-iteration-ranges-of-for-equations} -- except that the \lstinline!expression! of a \lstinline!for!-statement is not restricted to a parameter-expression.

If the \lstinline!for!-statement contains expressions that will generate events the range should be an evaluable expression.
\begin{nonnormative}
The same event-generating expression in different iterations of the for-loop are seen as different crossing functions, and the restriction ensures that their number is known during translation time.
\end{nonnormative}
\begin{example}
\begin{lstlisting}[language=modelica]
for i in 1 : 10 loop // i takes the values 1, 2, 3, $\ldots$, 10
Expand Down

0 comments on commit d6176e3

Please sign in to comment.