diff --git a/chapters/arrays.tex b/chapters/arrays.tex index e5cbc47c1..0fdc37bf8 100644 --- a/chapters/arrays.tex +++ b/chapters/arrays.tex @@ -1021,14 +1021,18 @@ \subsection{Indexing with Boolean or Enumeration Values}\label{indexing-with-boo \subsection{Indexing with end}\label{indexing-with-end} -The expression \lstinline!end! may only appear inside array subscripts, and if used in the $i$:th subscript of an array expression \lstinline!A! it is equivalent -to \lstinline!size(A, $i$)! provided indices to \lstinline!A! are a subtype of \lstinline!Integer!. If used inside nested array subscripts it refers -to the most closely nested array. - +The expression \lstinline!end! may only appear inside array subscripts, and if used in the $i$:th subscript of an array expression \lstinline!A! it is equivalent to the upper bound of the $i$:th dimension of \lstinline!A!. +If used inside nested array subscripts it refers to the most closely nested array. +\begin{nonnormative} +If indices to \lstinline!A! are a subtype of \lstinline!Integer! it is equivalent to \lstinline!size(A,i)!. +\end{nonnormative} \begin{example} \begin{lstlisting}[language=modelica, escapechar=!] A[end - 1, end] !is! A[size(A,1) - 1, size(A,2)] A[v[end], end] !is! A[v[size(v,1)], size(A,2)] // !\emph{First}! end !\emph{is referring to end of v.}! + +Real B[Boolean]; +B[end] !is! B[true] \end{lstlisting} \end{example}