object
expected
Constructors for expected terms. An expected term contains either a value or an error. Expected terms should be regarded as opaque terms and always used with the expected/1
object by passing the expected term as a parameter.
logtalk_load(expecteds(loader))
static, context_switching_calls
Type-checking support: This object also defines a type
expected
for use with thetype
library object.
Public predicates
of_unexpected/2
Constructs an expected term from an error that represent that the expected value is missing.
static
of_unexpected(Error,Expected)
of_unexpected(@term,--nonvar)
- one
of_expected/2
Constructs an expected term from an expected value.
static
of_expected(Value,Expected)
of_expected(@term,--nonvar)
- one
from_goal/4
Constructs an expected term holding a value bound by calling the given goal. Otherwise returns an expected term with the unexpected goal error or failure represented by the Error
argument.
static
from_goal(Goal,Value,Error,Expected)
from_goal(0,*,*,*)
from_goal(+callable,--term,@term,--nonvar)
- one
from_goal/3
Constructs an expected term holding a value bound by calling the given goal. Otherwise returns an expected term with the unexpected goal error or the atom fail
representing the unexpected failure.
static
from_goal(Goal,Value,Expected)
from_goal(0,*,*)
from_goal(+callable,--term,--nonvar)
- one
from_goal/2
Constructs an expected term holding a value bound by calling the given closure. Otherwise returns an expected term holding the unexpected closure error or the atom fail
representing the unexpected failure.
static
from_goal(Closure,Expected)
from_goal(1,*)
from_goal(+callable,--nonvar)
- one
from_generator/4
Constructs expected terms with the values generated by calling the given goal. On goal error or failure, returns an expected term with the unexpected goal error or failure represented by the Error
argument.
static
from_generator(Goal,Value,Error,Expected)
from_generator(0,*,*,*)
from_generator(+callable,--term,@term,--nonvar)
- one_or_more
from_generator/3
Constructs expected terms with the values generated by calling the given goal. On goal error or failure, returns an expected term with, respectively, the unexpected goal error or the atom fail
representing the unexpected goal failure.
static
from_generator(Goal,Value,Expected)
from_generator(0,*,*)
from_generator(+callable,--term,--nonvar)
- one_or_more
from_generator/2
Constructs expected terms with the values generated by calling the given closure. On closure error or failure, returns an expected term with, respectively, the unexpected closure error or the atom fail
representing the unexpected closure failure.
static
from_generator(Closure,Expected)
from_generator(1,*)
from_generator(+callable,--nonvar)
- one_or_more
Protected predicates
(no local declarations; see entity ancestors if any)
Private predicates
(no local declarations; see entity ancestors if any)
Operators
(none)
See also