Logtalk built-in predicate: create_protocol/3

contents > reference manual > built-in predicates

## `create_protocol/3`

#### Description

>     create_protocol(Identifier, Relations, Directives)

> Creates a new, dynamic, protocol.

#### Template and modes

>     create_protocol(+protocol_identifier, +list, +list)

#### Errors

> Identifier is a variable:
>   `instantiation_error`
> Identifier is not a valid protocol identifier:
>   `type_error(protocol_identifier, Identifier)`
> Identifier is already in use:
>   `permission_error(replace, category, Identifier)`
>   `permission_error(replace, object, Identifier)`
>   `permission_error(replace, protocol, Identifier)`
> Relations is not a list:
>   `type_error(list, Relations)`
> Directives is not a list:
>   `type_error(list, Directives)`

#### Examples

>     | ?- create_protocol(foo, [extends(bar)], [public(foo/1)]).

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