Skip to content

Commit

Permalink
Merge pull request #2558 from bakaq/error_to_doclog
Browse files Browse the repository at this point in the history
Convert library(error) docs to Doclog format
  • Loading branch information
mthom authored Sep 16, 2024
2 parents 12a61cd + 238f1bd commit a898d7a
Showing 1 changed file with 33 additions and 38 deletions.
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

0 comments on commit a898d7a

Please sign in to comment.