Operator precedence: Difference between revisions

Line 2,183:
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).
<br>Messages are one of 3 types:
<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)
Line 2,194:
<br>Keyword examples:
<br><code>. min: max: at: at:put: from:to:do: bitAnd: bitOr:</code>
 
Within unary and binary messages, evaluation is strictly left to right. Keyword messages must be parenthesized.
 
No table can be presented here: there are too many such operators, and they can also be freely added by the programmer (i.e. you may define your own "Number fooBar" or "Number +-+-+ arg" messages (if it makes any sense to you).
Anonymous user