Operator precedence: Difference between revisions

(→‎{{header|Phix}}: added the new operators for 0.8.2)
Line 2,179:
|}
Note: // is the Euclidean division
 
=={{header|Smalltalk}}==
Smalltalk does not have operators which are built in to the language.
<br>All operations are message sends to a receiver object (aka virtual function calls). Messages are one of:
<br> <I>unary message</I>: no argument, alphanumeric name (highest precedence; left to right evaluation)
<br> <I>binary message</I>: any combination of special characters (left to right evaluation)
<br> <I>keyword message</I>: one or more arguments, alphanumeric name with colons (lowest precedence)
 
Unary message examples:
<br><code> negated abs conjugated size isZero</code>
<br>Binary examples:
<br><code>. + - * % <=> ===> ˜˜ ˜= =</code>
<br>Keyword examples:
<br><code>. min: max: at: at:put: from:to:do: bitAnd: bitOr:</code>
 
Math expressions are usually parenthesized for better readability (by beginners):
<lang smalltalk>5 + b negated. "same as 5 + (b negated)"
a abs - b sqrt "same as (a abs) - (b sqrt)"
(a bitAnd:1) bitOr:(b bitAnd:2). "same as what you read"
 
"Beginners might be confused by:"
5 + a * b "same as (5 + a) * b"</lang>
 
=={{header|Tcl}}==
Anonymous user