Append an object to a list
list_append (List_Type object, Int_Type nth)
The list_append
function is like list_insert
except
this function inserts the object into the list after the nth
item. See the documentation on list_insert
for more details.
list_insert, list_delete, list_pop, list_new, list_reverse
Remove an item from a list
list_delete (List_Type list, Int_Type nth)
This function removes the nth
item in the specified list.
The first item in the list corresponds to a value of nth
equal to zero. If nth
is negative, then the indexing is with
respect to the end of the list with the last item corresponding to
nth
equal to -1.
list_insert, list_append, list_pop, list_new, list_reverse
Insert an item into a list
list_insert (List_Type list, object, Int_Type nth)
This function may be used to insert an object before the nth
position in a list. The first item in the list corresponds to a
value of nth
equal to zero. If nth
is negative, then
the indexing is with respect to the end of the list with the last
item given by a value of nth
equal to -1.
It is important to note that
list_insert (list, object, 0);
is not the same as
list = {object, list}
since the latter creates a new list with two items, object
and the old list.
list_append, list_pop, list_delete, list_new, list_reverse
Create a new list
List_Type list_new ()
This function creates a new empty List_Type
object. Such a
list may also be created using the syntax
list = {};
list_delete, list_insert, list_append, list_reverse, list_pop
Extract an item from a list
object = list_pop (List_Type list [, Int_Type nth])
The list_pop
function returns a object from a list deleting
the item from the list in the process. If the second argument is
present, then it may be used to specify the position in the list
where the item is to be obtained. If called with a single argument,
the first item in the list will be used.
list_delete, list_insert, list_append, list_reverse, list_new
Reverse a list
list_reverse (List_Type list)
This function may be used to reverse the items in list.
This function does not create a new list. The list passed to the function will be reversed upon return from the function. If it is desired to create a separate reversed list, then a separate copy should be made, e.g.,
rev_list = @list;
list_reverse (rev_list);
list_new, list_insert, list_append, list_delete, list_pop