Skip to content
Open
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
4 changes: 4 additions & 0 deletions chapters/equations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ \subsection{Simple Equality Equations}\label{simple-equality-equations}
Also compare with \cref{assignments-from-called-functions-with-multiple-results} about calling functions with multiple outputs in assignment statements.
\end{nonnormative}

Note that there is also \lstinline!function_name(inexpr1, inexpr2);! which calls the given function or operator.
It behaves similarly to a simple equation (calling the function or operator but ignoring any potential output), even if it uses a different production in the grammar.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this new semantics, or is this already established in some other form somewhere else? (I am surprised that this would be allowed for a function with outputs; I would have expected that a simple equation/assignment with an empty parenthesis in the left-hand side was needed.)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
It behaves similarly to a simple equation (calling the function or operator but ignoring any potential output), even if it uses a different production in the grammar.
It behaves similarly to a simple equation (calling the function or operator), even if it uses a different production in the grammar.

I'll have to investigate more to see if it exists, but for now it seems simplest to just remove that part; to not draw attention to it. In general procedure calls have not been handled well.

Note: I assume you specifically mean the part about ignoring outputs; as the other semantics is already used in MSL, e.g., for Modelica.Utilities.Streams.print, Modelica.Utilities.Streams.error (and some assert-media function as far as I recall).

Ignoring outputs is implicitly assumed in https://specification.modelica.org/master/interface-or-type-relationships.html#function-compatibility-or-function-subtyping-for-functions - because otherwise a function adding a new output after the last one would need a sub-typing exception for functions with no outputs.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it is delayed we can discuss and clarify it further, including stating that procedure call for functions with outputs is not recommended, but simplifies function sub-typing.

It is used for special operators like \lstinline!reinit! (\cref{reinit}), \lstinline!assert! (\cref{assert}), and \lstinline!terminate! (\cref{terminate}).
Comment thread
HansOlsson marked this conversation as resolved.


\subsection{For-Equations -- Repetitive Equation Structures}\label{for-equations-repetitive-equation-structures}

Expand Down