Operators and Their Precedence

There are two types of operators defined in the SNOBOL4 language. These are prefix, unary operators and infix, binary operators. Unary operators are higher in precedence than any binary operator. Binary operators have the associativity and precedence indicated in the following figure:


OP Definition as unary operator Definition as binary operator Binary association Binary precedence
~ negation not defined right 12
? interrogation not defined left 12
$ indirect reference immediate assignment left 11
. name conditional assignment left 11
! not defined exponentiation right 10
** not defined exponentiation right 10
^ not defined exponentiation right 10
% not defined not defined left 9
* unevaluated expression multiplication left 8
/ not defined division left 7
# not defined not defined left 6
+ positive addition left 5
- negative subtraction left 5
@ cursor position not defined left 4
blank not allowed concatenation left 3
| not defined alternation left 2
& keyword not defined left 1
Note: ! ** and ^ are treated as the same operator.

Figure 3. SNOBOL4 Operators

Prior Page, Next Page, First Page of the Minnesota SNOBOL4 Reference