From d04200f469aabd2530db96e30defc5f35e4f5661 Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Tue, 24 Nov 2020 23:01:03 +0100 Subject: [PATCH] Add cross references to description of assignment to subscripted array variables --- chapters/arrays.tex | 11 +++++------ chapters/statements.tex | 7 +++++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/chapters/arrays.tex b/chapters/arrays.tex index 9f7b13a69..aad9b963d 100644 --- a/chapters/arrays.tex +++ b/chapters/arrays.tex @@ -1037,12 +1037,11 @@ \section{Scalar, Vector, Matrix, and Array Operator Functions}\label{scalar-vect \subsection{Equality and Assignment}\label{equality-and-assignment} -Equality \lstinline!a = b! and assignment \lstinline!a := b! of scalars, vectors, matrices, and -arrays is defined element-wise and require both objects to have the same -number of dimensions and corresponding dimension sizes. The operands -need to be type equivalent. This is legal for the simple types and all -types satisfying the requirements for a record, and is in the latter -case applied to each component-element of the records. +Equality \lstinline!a = b! and assignment \lstinline!a := b! of scalars, vectors, matrices, and arrays is defined element-wise and require both objects to have the same number of dimensions and corresponding dimension sizes. +See \cref{array-indexing} regarding assignments to array variables with repeated subscripts. + +The operands need to be type equivalent. +This is legal for the simple types and all types satisfying the requirements for a record, and is in the latter case applied to each component-element of the records. \begin{table}[H] \caption{Equality and assignment of arrays and scalars. The scalar \tablehead{Operation} applies for all $j$ in $1,\, \ldots,\, n$ and $k$ in $1,\, \ldots,\, m$.} diff --git a/chapters/statements.tex b/chapters/statements.tex index be96afcd7..8359939fd 100644 --- a/chapters/statements.tex +++ b/chapters/statements.tex @@ -125,8 +125,11 @@ \subsection{Simple Assignment Statements}\label{simple-assignment-statements} component-reference ":=" expression \end{lstlisting} -The \lstinline!expression! is evaluated. The resulting value is stored into the -variable denoted by \lstinline!component-reference!. +The \lstinline[language=grammar]!expression! is evaluated. +The resulting value is stored into the variable denoted by \lstinline[language=grammar]!component-reference!. + +Assignment to array variables with subscripts is described in \cref{array-indexing}. + \subsubsection{Assignments from Called Functions with Multiple Results}\label{assignments-from-called-functions-with-multiple-results}