Logtalk control construct: ::/2

contents > reference manual > control constructs

## `::/2`

#### Description

>     Object::Predicate

>     (Object1, Object2, ...)::Predicate

>     (Object1; Object2; ...)::Predicate

>     Object::(Predicate1, Predicate2, ...)

>     Object::(Predicate1; Predicate2; ...)

> Sends a message to an object. The message argument must match a public predicate of the receiver object. We can also send the same message to a set of objects or a set of messages to the same object. The "`,`" and "`;`" in the list have the usual Prolog meaning.

#### Template and modes

>     +receivers::+messages

#### Errors

> Either Object or Predicate is a variable:
>   `instantiation_error`
> Predicate is declared private:
>   `permission_error(access, private_predicate, Predicate)`
> Predicate is declared protected:
>   `permission_error(access, protected_predicate, Predicate)`
> Predicate is not declared:
>   `existence_error(predicate_declaration, Predicate)`
> Object does not exist:
>   `existence_error(object, Object)`

#### Examples

>     | ?- list::member(X, [1, 2, 3]).

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