Skip to content

Commit

Permalink
Non-normative explanation why impure don't matter.
Browse files Browse the repository at this point in the history
  • Loading branch information
HansOlsson committed Nov 4, 2021
1 parent 287c35b commit 29745d8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions chapters/operatorsandexpressions.tex
Expand Up @@ -1422,6 +1422,13 @@ \subsection{Function Variability}\label{function-variability}
This has additional implications for redeclarations, see \cref{function-compatibility}.
The purity of the function, see \cref{pure-modelica-functions}, does not influence the variability of the function call.

\begin{nonnormative}
The reason the variability ignores if functions is declared as \lstinline!impure! is that even in this case variability does not depend on the function.
Consider a function reading an external file and returning some value from that file.
Different uses can have the file updated before the simulation (as a parameter-expression), or during the simulation (as a discrete-time expression).
Thus it depends on the use case and the specific file, not the function itself, and it would even be possible to update the file in continuous time (as part of an algorithm) and still use the same function.
\end{nonnormative}

\subsection{Constant Expressions}\label{constant-expressions}

Constant expressions\index{constant expression}\index{expression variability!constant} are:
Expand Down

0 comments on commit 29745d8

Please sign in to comment.