diff --git a/chapters/operatorsandexpressions.tex b/chapters/operatorsandexpressions.tex index 60ccb74e5..9802ecbda 100644 --- a/chapters/operatorsandexpressions.tex +++ b/chapters/operatorsandexpressions.tex @@ -103,9 +103,10 @@ \section{Operator Precedence and Associativity}\label{operator-precedence-and-as \end{center} \end{table} -The postfix array index and postfix access operators are not expression operators in the normal sense that \lstinline!a.b[1]! can be treated as \lstinline!a.(b[1])!. +The postfix array index and postfix access operators are not merely expression operators in the normal sense that \lstinline!a.b[1]! can be treated as \lstinline!a.(b[1])!. Instead, these operators need to be considered jointly to identify an entire \lstinline[language=grammar]!component-reference! (one of the alternative productions for \lstinline[language=grammar]!primary! in the grammar) which is the smallest unit that can be seen as an expression in itself. -Postfix array index and postifx access can only be applied immediately to a \lstinline[language=grammar]!component-reference!; not even parentheses around the left operand are allowed. +Postfix access can only be applied immediately to a \lstinline[language=grammar]!component-reference!; not even parentheses around the left operand are allowed. +Postfix array index can additionally be applied if there are parentheses around the left operand, see \cref{indexing}. \begin{example} Relative precedence of postfix array index and postfix access. @@ -130,7 +131,6 @@ \section{Operator Precedence and Associativity}\label{operator-precedence-and-as \end{lstlisting} The relation between \lstinline!a.x!, \lstinline!a.x[2]!, and \lstinline!(a.x)[2]! illustrates the effect of giving higher precedence to array index than postfix access. Had the precedence been equal, this would have changed the meaning of \lstinline!a.x[2]! to the same thing that \lstinline!(a.x)[2]! expresses, being a component reference of type \lstinline!Real[2]!. -Note that \lstinline!(a.x)[2]! was illegal in version 3.6 and earlier. \end{example} \begin{example}