Algosim documentation: VarRemove

VarRemove

Removes one or more values from a linear container variable.

Syntax

If X is an lvalue and a container and R a range (see part and range), then VarRemove(X, R) removes the elements specified by R from X and returns success.

This is the procedural version of remove.

Examples

v ≔ SequenceVector(10)
(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
VarRemove(v, 5)
success
v
(1, 2, 3, 4, 6, 7, 8, 9, 10)
v ≔ SequenceVector(10)
(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
VarRemove(v, range(1, −1, 2))
success
v
 ⎛2 ⎞
 ⎜4 ⎟
e⎜6 ⎟
 ⎜8 ⎟
 ⎝10⎠

See also