clear!

Syntax

clear!(X)

Arguments

X is a vector/matrix/set/dictionary.

Details

Clear the contents of X. After execution X still exists. It retains its initial data type and can be appended with new data.

Examples

$ x=1 2 3;
$ clear!(x);
[]
$ typestr x;
FAST INT VECTOR
$ size x;
0
$ x.append!(1..6);
[1,2,3,4,5,6]

$ y=set(8 9 4 6);
$ y.clear!();
set()

$ x=1..3;
$ y=4..6;
$ z=dict(x,y);
$ z;
3->6
1->4
2->5
$ z.clear!();