protocol
List protocol.
Paulo Moura
1.2
2004/5/9
static
(no dependencies on other files)
Appends two lists.
static
append(List1, List2, List)
append(?list, ?list, ?list) – zero_or_more
Deletes from a list all ocurrences of an element returning the list of remaining elements.
static
delete(List, Element, Remaining)
delete(@list, @term, ?list) – one
Deletes all matching elements from a list, returning the list of remaining elements.
static
delete_matches(List, Element, Remaining)
delete_matches(@list, @term, ?list) – one
True if the argument is an empty list.
static
empty(List)
empty(@list) – zero_or_one
Flattens a list of lists into a list.
static
flatten(List, Flatted)
flatten(+list, -list) – one
Sorts a list of key-value pairs in ascending order.
static
keysort(List, Sorted)
keysort(+list, -list) – one
List last element (if it exists).
static
last(List, Last)
last(?list, ?term) – zero_or_more
List length.
static
length(List, Length)
length(?list, ?integer) – zero_or_more
Determines the list maximum value using standard order. Fails if the list is empty.
static
max(List, Maximum)
max(+list, -term) – zero_or_one
Element is a list member.
static
member(Element, List)
member(?term, ?list) – zero_or_more
Checks if a term is a member of a list.
static
memberchk(Element, List)
memberchk(?term, ?list) – zero_or_one
Determines the minimum value in a list using standard order. Fails if the list is empty.
static
min(List, Minimum)
min(+list, -term) – zero_or_one
X and Y are consecutive elements in List.
static
nextto(X, Y, List)
nextto(?term, ?term, ?list) – zero_or_more
Nth element of a list (counting from zero).
static
nth0(Nth, List, Element)
nth0(?integer, ?list, ?term) – zero_or_more
Nth element of a list (counting from zero).
static
nth0(Nth, List, Element, Residue)
nth0(?integer, ?list, ?term, ?list) – zero_or_more
Nth element of a list (counting from one).
static
nth1(Nth, List, Element)
nth1(?integer, ?list, ?term) – zero_or_more
Nth element of a list (counting from zero).
static
nth1(Nth, List, Element, Residue)
nth1(?integer, ?list, ?term, ?list) – zero_or_more
The two lists are a permutation of the same list.
static
permutation(List, Permutation)
permutation(?list, ?list) – zero_or_more
Prefix is a prefix of List.
static
prefix(Prefix, List)
prefix(?list, +list) – zero_or_more
Reverses a list.
static
reverse(List, Reversed)
reverse(+list, ?list) – zero_or_one
reverse(?list, +list) – zero_or_one
reverse(-list, -list) – one_or_more
The two lists have the same length.
static
same_length(List1, List2)
same_length(+list, ?list) – zero_or_one
same_length(?list, +list) – zero_or_one
same_length(-list, -list) – one_or_more
Selects an element from a list, returning the list of remaining elements.
static
select(Element, List, Remaining)
select(?term, +list, ?list) – zero_or_more
select(?term, ?list, +list) – zero_or_more
Sorts a list in ascending order.
static
sort(List, Sorted)
sort(+list, -list) – one
The first list is a sublist of the second.
static
sublist(Sublist, List)
sublist(?list, +list) – zero_or_more
Removes all elements in the second list from the first list, returning the list of remaining elements.
static
subtract(List, Elements, Remaining)
subtract(+list, +list, -list) – one
Suffix is a suffix of List.
static
suffix(Suffix, List)
suffix(?list, +list) – zero_or_more
(none)
(none)