[Contents] · [Home] · [Mail]

SALIERI Language - Operator "+" (_PLUS)

_PLUS: int x int -> int
_PLUS: real x real -> real
_PLUS: string x string -> string
_PLUS: sequence x sequence -> sequence
_PLUS: segment x segment -> segment
_PLUS: list x list -> list

Call syntax:
_PLUS(x, y)
x + y

The binary infix operator "+" realises arithmetic addition on integers and reals as well as concatenation on the serial types string, list, and sequence.

On segments, it implements a concatenation on the duration normalised voices. For poly-normalised segments with an identical number of voices, this is done by simply concatening the corresponding pairs of voices into the voices of the result segment. If one or both argument segments are not poly-normalised, i.e., the voices within a segment have different relative durations, an equal duration of all voices is achieved by appending rests as required. If the number of voices of the argument segments is not identical, the one with a smaller number of voices is filled with empty voices (i.e., voices only containing rests).

For the infix operator "+", there is a corresponding predefined function _PLUS, such that a + b and _PLUS(a,b) are equivalent expressions.

In expressions, "+" binds stronger than the relational and equality operators, but weeker than multiplication, division, and the length operator (#).

> 1+3
Result= 4
> 0.5+10.3
Result= 10.8
> 5+10.3
Result= 15.3
> "abra"+"cadabra"
Result= "abracadabra"
> {[f#/2 g/4 e/2],[c0/1]} + {[c1/2]}
Result= SEGM([ f#1/2 g1/4 e1/2 c1/2 ],[ c0*1 _/4 _/2 ])

See also: segment (Object Type), Operators and Expressions.

[Contents] · [Home] · [Mail]
© sic!systems, page frame designed by hh; this page has been automatically generated from the SALIERI Documentation Database.