library(types)
This library module provides more and better type tests. For the purposes of this library, we first define an abstract type typeterm, as follows:
typeterm | ::= atom
|
| atomic
| |
| callable
| |
| character
| |
| character_code
| |
| compound
| |
| db_reference
| |
| float
| |
| float( rangeterm)
| |
| ground
| |
| integer
| |
| integer( rangeterm)
| |
| list
| |
| list( Type)
| |
| nonvar
| |
| number
| |
| number( rangeterm)
| |
| oneof( L)
| |
| mutable
| |
| pair
| |
| pred_spec
| |
| pred_spec_tree
| |
| proper_list
| |
| proper_list( Type)
| |
| simple
| |
| term
| |
| var
| |
rangeterm | ::= between(L,U)
|
| >=(L)
| |
| >(L)
| |
| =\=(L)
|
Exported predicates:
must_be(
+Term,
+Type,
+Goal,
+ArgNo)
illarg(
+ErrorTerm,
+Goal,
+ArgNo)
illarg(
+ErrorTerm,
+Goal,
+ArgNo,
+Culprit)
var
type(
ErrorType)
must_be(
Culprit,
ErrorType,
Goal,
ArgNo)
.
domain(
ErrorType,
ErrorDomain)
must_be(
Culprit,
ErrorType,
Goal,
ArgNo)
.
If the type is valid, a
Domain Error is raised with the expected domain being
ErrorDomain.
force_type(
ExpType)
context(
ContextType,
CommandType)
existence(
ObjType,
Culprit,
Message)
permission(
Operation,
ObjType,
Message)
representation(
ErrorType)
evaluation(
ErrorType)
consistency(
Culprit1,
Culprit2,
Message)
syntax(
Pos,
Msg,
Tokens,
AfterError)
resource(
Resource)
system(
Message)