Operators and Predefined Functions

The main operators and predefined functions are outlined in the following chapters together with the main data types involved. Here we sketch some operators and functions that are not linked to a specific type. The predefined functions are listed in annex Library.

Conditional Expression

An important operator is the conditional à la C:

          (cond ? exp₁ : exp₂)

returns the value of the expression exp₁ if the expression cond evaluates to true and else exp2. The parentheses are mandatory.

As usual, the conditional operator is a special function: it does not evaluate all of its arguments. If cond is true, only exp₁ is evaluated, and similarly for false and exp₂.

In the body of a function, a conditional can be written using the usual syntax:

      if (cond) { exp₁ } else { exp₂ }

see chapter Functions.

Beware not to confuse the conditional action and the conditionnal expression presented here. The body of the former is a sequence of actions; the latter, an expression. The former does not return a value, contrary to the latter.

@empty and @size

The predicate @empty returns true if its argument is an empty map, tab or string, and false otherwise.

Function @size accepts any kind of argument and returns:

Alphabetical Listing of Antescofo Predefined Functions