protocol

metap

Useful meta-predicates protocol.

author:
Paulo Moura
version:
3.0
date:
2006/9/17
compilation:
static

(no dependencies on other files)

Public interface

callable/1

True if the argument can be called as a goal.

compilation:
static
template:
callable(Term)
mode – number of solutions:
callable(@term) – zero_or_one

filter/3

Returns a list of all list elements that satisfy a predicate.

compilation:
static
template:
filter(Predicate, In, Out)
metapredicate template:
filter(1, *, *)
mode – number of solutions:
filter(+callable, +list, -list) – one

ignore/1

Calls Goal once but always succeeds, even if Goal fails.

compilation:
static
template:
ignore(Goal)
metapredicate template:
ignore(::)
mode – number of solutions:
ignore(@callable) – one

map/3

Maps a predicate over a list of elements.

compilation:
static
template:
map(Predicate, In, Out)
metapredicate template:
map(2, *, *)
mode – number of solutions:
map(+callable, ?list, ?list) – zero_or_more

succeeds/2

True if the predicate succeeds for each list element.

compilation:
static
template:
succeeds(Predicate, List)
metapredicate template:
succeeds(1, *)
mode – number of solutions:
succeeds(+callable, +list) – zero_or_more

Protected interface

(none)

Private predicates

(none)

Remarks

(none)