Skip to content

Commit

Permalink
Closes #2159
Browse files Browse the repository at this point in the history
Seemed easier to add it in this place, and extend the example to include all variants.
  • Loading branch information
HansOlsson committed May 10, 2019
1 parent 6618d6e commit 4b8a39d
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion chapters/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,22 @@ \subsection{Component Declaration Static Semantics}\doublelabel{component-declar
in that order.

Array dimensions shall be non-negative parameter expressions, or the
colon operator denoting that the array dimension is left unspecified.
colon operator denoting that the array dimension is left unspecified.
Both variants can also be part of short class definitions.

\begin{nonnormative}
Example of variables with array dimensions.
\begin{lstlisting}[language=Modelica]
model ArrayVariants
type T=Real[:];
parameter T x=ones(4);
parameter T y[3]=ones(3, 4);
parameter Real a[2]=ones(2);
parameter Real b[2, 0]=ones(2, 0);
parameter Real c[:]=ones(0);
end ArrayVariants;
\end{lstlisting}
\end{nonnormative}

The rules for components in functions are described in \autoref{function-as-a-specialized-class}.

Expand Down

0 comments on commit 4b8a39d

Please sign in to comment.