up previous next

Insert, Remove

Syntax

Insert(V:LIST,N:INT,E:OBJECT):NULL
Remove(V:LIST,N:INT):NULL

where V is a variable containing a list.
    

Summary

insert or remove an object in a list

Description

The first function inserts E into the list L as the N-th component.

example

    
L := ["a","b","d","e"];
Insert(L,3,"c");
L;
["a", "b", "c", "d", "e"]
-------------------------------
        
    
The second function removes the N-th component from L. (The function WithoutNth returns the list obtained by removing the N-th component of L without affecting L, itself.)

example

    
Use R ::= Q[x,y,z];
L := Indets();
L;
[x, y, z]
-------------------------------
Remove(L,2);
L;
[x, z]
-------------------------------
        
    

See Also