Logtalk built-in method: current_predicate/1

contents > reference manual > built-in methods

## `current_predicate/1`

#### Description

>     current_predicate(Predicate)

> Enumerates, by backtracking, the visible user predicates for an object.

#### Template and modes

>     current_predicate(?predicate_indicator)

#### Errors

> Predicate is neither a variable nor a valid predicate indicator:
>   `type_error(predicate_indicator, Predicate)`

#### Examples

> To enumerate, by backtracking, the user predicates visible in this:
>   `current_predicate(Predicate)`
> To enumerate, by backtracking, the public and protected user predicates visible in self:
>   `::current_predicate(Predicate)`
> To enumerate, by backtracking, the public user predicates visible for an object:
>   `Object::current_predicate(Predicate)`

previous | glossary | next
Copyright © Paulo Moura — Logtalk.org