11.3.20 bagof/3 [ISO]

Synopsis

bagof(+Template, +Generator, -Set)

Like setof/3 except that the list (or alternative lists) returned will not be ordered, and may contain duplicates. This relaxation saves time and space in execution.

Arguments

Template
term
:Generator
callable, must be nonvar

A goal to be proved as if by call/1.

Set
list of term, non-empty set

Exceptions

Call errors (see ref-sem-exc).

Examples

See findall/3 for examples that illustrate the differences among findall/3, setof/3, and bagof/3.

See Also

findall/3, setof/3, ^/2, ref-all.


Send feedback on this subject.