## 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:

- for aggregate values, the “size” of the arguments; that is, for a map, the number of entries in the dictionary, for a tab the number of elements, for a nim, the dimension of the nim and for a string the number of characters in the string.

- for scalar values, @size returns a strictly negative number. This negative number depends only on the type of the argument, not on the value of the argument.

## Alphabetical Listing of Antescofo Predefined Functions

@!=

@%

@&&

@!=

@%

@&&

@*

@+

@-

@<

@<=

@==

@>

@>=

@div

@||

@+

@-

@<

@<=

@==

@>

@>=

@div

@||

@abs

@acos

@active

@add_pair

@aggregate

@align_breakpoints

@approx

@arch_darwin

@arch_linux

@arch_windows

@asin

@atan

@between

@bounded_integrate

@bounded_integrate_inv

@car

@cdr

@ceil

@clear

@concat

@cons

@copy

@cos

@cosh

@count

@dim

@domain

@drop

@dump

@dumpvar

@empty

@exp

@explode

@filter_max_t

@filter_median_t

@filter_min_t

@find

@flatten

@floor

@gnuplot

@gshift_map

@history_length

@insert

@integrate

@iota

@is_bool

@is_defined

@is_exec

@is_fct

@is_float

@is_function

@is_int

@is_integer_indexed

@is_interpolatedmap

@is_list

@is_map

@is_nim

@is_numeric

@is_obj

@is_obj_xxx

@is_prefix

@is_proc

@is_string

@is_subsequence

@is_suffix

@is_symbol

@is_tab

@is_undef

@is_vector

@lace

@last

@linearize

@listify

@loadvalue

@loadvar

@log

@log10

@log2

@make_bpm_map

@make_bpm_tab

@make_duration_map

@make_duration_tab

@make_label_bpm

@make_label_duration

@make_label_pitches

@make_label_pos

@make_score_map

@map

@map_compose

@map_concat

@map_history

@map_history_date

@map_history_rdate

@map_normalize

@map_reverse

@mapval

@max

@max_key

@max_val

@median

@member

@merge

@min

@min_key

@min_val

@normalize

@number_active

@occurs

@permute

@plot

@pow

@projection

@push_back

@push_front

@rand

@rand_int

@random

@range

@reduce

@remove

@remove_duplicate

@replace

@reshape

@resize

@reverse

@rnd_bernoulli

@rnd_binomial

@rnd_exponential

@rnd_gamma

@rnd_geometric

@rnd_normal

@rnd_uniform_float

@rnd_uniform_int

@rotate

@round

@rplot

@sample

@savevalue

@scan

@score_tempi

@scramble

@select_map

@set_osc_handling_tab

@shape

@shift_map

@simplify_lang_v

@simplify_radial_distance_t

@simplify_radial_distance_v

@sin

@sinh

@size

@slice

@sort

@sputter

@sqrt

@string2fun

@string2proc

@stutter

@system

@tab_history

@tab_history_date

@tab_history_rdate

@take

@tan

@Tracing

@UnTracing

@window_filter_t

#### Search

From here you can search these documents. Enter your search terms below.