Skip to content

Commit

Permalink
Clarify that ternary use of array range isn't a problem for associati…
Browse files Browse the repository at this point in the history
…vity
  • Loading branch information
henrikt-ma committed Feb 22, 2022
1 parent d6cce50 commit 075f5e4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions chapters/operatorsandexpressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ \section{Operator Precedence and Associativity}\label{operator-precedence-and-as
A precedence group may also be non-associative, meaning that there is no implicit subexpression structure defined based on associativity.
For example, non-associativity of relational operators means that \lstinline!1 < 2 < 3! is an invalid expression.
Note that the operators don't need to be identical for associativity to matter; also \lstinline!1 == 2 < 3! is invalid, and \lstinline!1 - 2 + 3! is implicitly structured as \lstinline!(1 - 2) + 3!.
Also note that the non-associative array range in Modelica can be used with either two or three operands separated by `\lstinline!:!', meaning that \lstinline!1 : 2 : 5! is one valid ternary use of the operator rather than two invalid binary uses of the operator.

\begin{nonnormative}
Associativity of a precedence group is a property of the Modelica operator symbols, and is not the same concept as mathematical operator associativity.
Expand Down

0 comments on commit 075f5e4

Please sign in to comment.