12.1.4 Unary operator calls

Dylan has two built-in unary operators, - and ~. The syntax for a unary operator call has two parts:

1. The operator

2. An operand

The - operator performs the arithmetic negation of its operand, and the ~ operator performs the logical negation. Both operator calls are abbreviations for function calls. The following examples are equivalent:

- time-offset;
negative(time-offset);

The following examples also are equivalent:

~ test-condition(cond);
\~(test-condition(cond));

In the preceding example, we must escape ~ with \ so that Dylan interprets ~ as a variable name, instead of as an operator. This syntax indicates an explicit call to the function that is the value of the variable named ~.