Logtalk reference manual
Built-in method: once/1
Contents > Reference Manual > Built-in Methods > once/1

## once/1

#### Description

    once(Goal)

This predicate behaves as `call(Goal)` but it is not re-executable. 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

    once(+callable)

#### Errors

Goal is a variable:
  `instantiation_error`
Goal is neither a variable nor a callable term:
  `type_error(callable, Goal)`

#### Examples

Call a goal deterministically in the context of the object or category containing the call:
  `once(Goal)`
To send a goal as a non-backtracable message to self:
  `once(::Goal)`
To send a goal as a non-backtracable message to an explicit object:
  `once(Object::Goal)`

#### See also

`call/1-N`, `ignore/1`, `\+/1`