Did you know ... Search Documentation:
lists.pl -- SICStus 3-compatible library(lists).
PublicShow source
See also
- https://sicstus.sics.se/sicstus/docs/3.12.11/html/sicstus/Lists.html
To be done
- This library is incomplete. As of SICStus 3.12.11, the following predicates are missing:
Source substitute(+OldElem, +List, +NewElem, -NewList) is det
NewList is List with all values that are identical (==) to OldElem replaced by NewElem.
Source nth(?Index, ?List, ?Element) is nondet
True if Element is the N-th element in List. Counting starts at 1.
deprecated
- use nth1/3.
Source nth(?Index, ?List, ?Element, ?Rest) is nondet
True if Element is the N-th element in List and Rest is the remainder (as if by select/3) of List. Counting starts at 1.
deprecated
- use nth1/4.
Source same_length(?List1, ?List2, ?Length) is nondet
True if List1 and List2 both have length Length.
Source sublist(?Sub, +List)
True when all members of Sub are members of List in the same order.
Compatibility
- sicstus. The order of generating sublists differs.
- This predicate is known in many Prolog implementations, but the semantics differ. E.g. In YAP it is a continuous sub-list.
Source suffix(?Suffix, ?List) is nondet
True if Suffix is a suffix of List. Not the same as suffix/2 in SICStus 4 - the arguments are reversed!

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

 is_list(Arg1)
Source nth0(Arg1, Arg2, Arg3)
Source nextto(Arg1, Arg2, Arg3)
Source delete(Arg1, Arg2, Arg3)
Source nth0(Arg1, Arg2, Arg3, Arg4)
 memberchk(Arg1, Arg2)
Source select(Arg1, Arg2, Arg3)
Source append(Arg1, Arg2, Arg3)
Source prefix(Arg1, Arg2)
Source member(Arg1, Arg2)
Source min_list(Arg1, Arg2)
Source max_list(Arg1, Arg2)
Source sum_list(Arg1, Arg2)
Source permutation(Arg1, Arg2)
Source reverse(Arg1, Arg2)
Source same_length(Arg1, Arg2)
Source last(Arg1, Arg2)