Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert library(error) docs to Doclog format #2558

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 33 additions & 38 deletions src/lib/error.pl
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,29 @@
:- meta_predicate check_(1, ?, ?).


/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
must_be(Type, Term)

This predicate is intended for type-checks of built-in predicates.

It asserts that Term is:

1) instantiated *and*
2) instantiated to an instance of the given Type.

It corresponds to usage mode +Term.

Currently, the following types are supported:

- atom
- boolean
- character
- chars
- in_character
- integer
- list
- octet_character
- octet_chars
- term
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
%% must_be(Type, Term)
%
% This predicate is intended for type-checks of built-in predicates.
%
% It asserts that Term is:
%
% 1) instantiated *and*
% 2) instantiated to an instance of the given Type.
%
% It corresponds to usage mode +Term.
%
% Currently, the following types are supported:
%
% - atom
% - boolean
% - character
% - chars
% - in_character
% - integer
% - list
% - octet_character
% - octet_chars
% - term

must_be(Type, Term) :-
must_be_(type, Type),
Expand Down Expand Up @@ -142,19 +140,16 @@
type(term).
type(not_less_than_zero).

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
can_be(Type, Term)

This predicate is intended for type-checks of built-in predicates.

It asserts that there is a substitution which, if applied to Term,
makes it an instance of Type.

It corresponds to usage mode ?Term.

It supports the same types as must_be/2.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

%% can_be(Type, Term)
%
% This predicate is intended for type-checks of built-in predicates.
%
% It asserts that there is a substitution which, if applied to Term,
% makes it an instance of Type.
%
% It corresponds to usage mode ?Term.
%
% It supports the same types as must_be/2.

can_be(Type, Term) :-
must_be(type, Type),
Expand Down
Loading