Skip to content

Commit

Permalink
Reformulate to have a non-normative introduction, followed by an actu…
Browse files Browse the repository at this point in the history
…al normative part.
  • Loading branch information
HansOlsson committed Sep 9, 2020
1 parent 711326c commit b425c4d
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions chapters/overloaded.tex
@@ -1,18 +1,19 @@
\chapter{Overloaded Operators}\label{overloaded-operators}

A Modelica \lstinline!operator record! can define the behavior for
operations such as constructing, adding, multiplying etc. This is done
using the specialized class \lstinline!operator! (a restricted class
similar to \lstinline!package!, see \cref{specialized-classes}) comprised of functions
implementing different variants of the operation for the record class in
which the respective \lstinline!operator! definition resides.
A Modelica \lstinline!operator record! can overload the behavior for
operations such as constructing, adding, multiplying etc.

\begin{nonnormative}
The overloading is defined in such a way that ambiguities are not allowed and give an error. Furthermore, it is sufficient to define overloading for scalars.
The overloading is defined in such a way that ambiguities are not allowed and give an error.
Furthermore, it is sufficient to define overloading for scalars.
Overloaded array operations are automatically deduced from the overloaded scalar operations.
\end{nonnormative}

The \lstinline!operator! keyword is followed by the name of the operation:
\section{Overview of overloaded operators}\label{overview-of-overloaded-operators}
In an \lstinline!operator record! the definition of operations are done using the specialized class \lstinline!operator!
(a restricted class similar to \lstinline!package!, see \cref{specialized-classes})
followed by the name of the operation. Each \lstinline!operator! class is
comprised of functions
implementing different variants of the operation for the \lstinline!operator record! class in
which the definition resides.
% This was something weird that could be seen as a table originally,
% that is somewhat awkward - but keeping it.
%
Expand Down

0 comments on commit b425c4d

Please sign in to comment.