Sfairadora

  • Reference Guide

insert_empty

insert_empty(seq, pos)
insert_empty(seq, pos, n)
var_seq <- insert_empty(seq, pos)
var_seq <- insert_empty(seq, pos, n)
Inserts one or more “empty” elements. An “empty” element is an element of the initial value of its type. The elements are inserted at the position pos. If the parameter n is specified, it determines the number of elements to be inserted. If it is not specified, one element is inserted. The first two variant of the function return the modified sequence, but the seq parameter itself is retained unchanged. The other two variants modify the sequence in place.

Parameters

seq
The sequence to be changed.
var_seq
An l-value of a sequence type, the value of which is to be changed.
pos
The position, where to insert (the type Int). The value 0 denotes the beginning of the sequence. If the parameter pos is a negative value or is beyond the sequence end, an error is returned.
n
The number of element to be inserted.

Return Value

The first two variants return the modified sequence, which is of the same type as the parameter seq.
The other two variants return l-value referring to the variable var_seq.

See Also