Operator precedence: Difference between revisions

Added AppleScript.
(Added AppleScript.)
Line 172:
| lowest || or ||logical or bits "or" || left || binary
|-
|}
 
=={{header|AppleScript}}==
 
From the AppleScript Language Guide, plus additional notes:
 
{| class="wikitable"
! Order !! Operators !! Associativity !! Type !! Additional notes
|-
| 1 || ( ) || Innermost to Outermost || Grouping ||
|-
| 2 || + - || Unary || Plus or minus sign for numbers || Plus sign omitted in compiled code.
|-
| 3 || ^ || Right to left || Exponiation || Sequences automatically parenthesised in compiled code.
|-
| 4 || * / div mod || Left to right || Multiplication and division || Also work with numeric text, giving integer or real results.
|-
| 5 || + - || Left to right || Addition and subtraction || ''Ditto''.
|-
| 6 || & || Left to right || Concatenation || If the right operand can't be coerced to the left's class, the result is a list containing both operands.
|-
| 7 || as || Left to right || Coercion ||
|-
| 8 || < ≤ > ≥ || None || Comparison || Also terms like ''is less than'', ''is not greater than or equal to'', etc. Mixtures of numbers and numeric text are compared as per the class of the left operand.
|-
| 9 || = ≠ || None || Equality and inequality || Also terms like ''is'' and ''is equal to''. Class and value are both considered.
|-
| 10 || not || Unary || Logical negation || Sequences automatically parenthesised in compiled code.
|-
| 11 || and || Left to right || Logical and ||
|-
| 12 || or || Left to right || Logical or ||
|}
 
557

edits