## Chapter 4 : OPERATORS

Following are lists of all the unary and binary operators in SNOBOL4. Unused operators may be attached to program-defined functions using the OPSYN function. Unary operators have equal precedence among themselves, and higher precedence than binary operators. Operators of higher precedence are performed first, unless reordered by parentheses. Where several instances of operators with the same priority appear, associativity specifies which one is performed first.

### 4.1 UNARY OPERATORS

All unary operators are left-associative: if several appear together, they are performed left-to-right.
```    Graphic        Name                  Definition
=======  =================    ==============================
+      plus                 arithmetic positive
-      minus                arithmetic negative
.      period               name of object (address)
\$      dollar sign          indirect reference through object
*      asterisk             unevaluated expression
&      ampersand            keyword
~      tilde                negation of success/failure
?      question mark        interrogation
@      at sign              cursor position assignment
/      slash                <none>
^, !   caret, exclamation   <none>
%      percent              <none>
#      pound sign           <none>
|      vertical bar         <none>
```

#### 4.1.1 Indirect Reference and Case-Folding

The indirect reference operator (\$) converts a string to a variable name. When case-folding is in effect, the string characters are treated as upper-case letters when producing the name. The string itself is not modified. Thus,

```    \$('abc')
```
references variable ABC when case-folding, and variable abc when not.

### 4.2 BINARY OPERATORS

```    Graphic    Name            Definition       Precedence Associates
======= =================  ===============  ========== ==========
~     tilde              <none>                 12      right
?     question mark      <none>                 12      left
.     period             conditional assignment 11      left
\$     dollar sign        immediate assignment   13      left
^, !  caret, exclamation exponentiation         12      right
**    double asterisk    exponentiation         12      right
%     percent            <none>                 11      left
*     asterisk           multiplication         10      left
/     slash              division                9      left
#     pound sign         <none>                  8      left