Logtalk built-in predicate: extends_protocol/2-3

contents > reference manual > built-in predicates

## `extends_protocol/2-3`

#### Description

>     extends_protocol(Protocol1, Protocol2)

>     extends_protocol(Protocol1, Protocol2, Scope)

> Enumerates, by backtracking, all pairs of protocols such that the first one extends the second.

#### Template and modes

>     extends_protocol(?protocol_identifier, ?protocol_identifier)

>     extends_protocol(?protocol_identifier, ?protocol_identifier, ?scope)

#### Errors

> Protocol1 is neither a variable nor a valid protocol identifier:
>   `type_error(protocol_identifier, Protocol1)`
> Protocol2 is neither a variable nor a valid protocol identifier:
>   `type_error(protocol_identifier, Protocol2)`
> Scope is neither a variable nor a valid entity scope:
>   `type_error(scope, Scope)`

#### Examples

>     | ?- extends_protocol(listp, Protocol).

>     | ?- extends_protocol(Protocol, termp, private).

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