Logtalk reference manual
Built-in method: setof/3
Contents > Reference Manual > Built-in Methods > setof/3

## setof/3

#### Description

    setof(Term, Goal, List)

See the Prolog ISO standard definition. This built-in meta-predicate is declared as a private method and thus cannot be used as a message to an object.

#### Template and modes

    setof(@term, +callable, -list)

#### Errors

> (see the Prolog ISO standard)

#### Examples

To find all solutions in the context of the object or category containing the call:
  `setof(Term, Goal, List)`
To find all solutions by sending the goal as a message to self:
  `setof(Term, ::Goal, List)`
To find all solutions by sending the goal as a message to an explicit object:
  `setof(Term, Object::Goal, List)`

#### See also

`bagof/3`, `findall/3`, `findall/4`, `forall/2`