• Places
    • Home
    • Graphs
    • Prefixes
  • Admin
    • Users
    • Settings
    • Plugins
    • Statistics
  • Repository
    • Load local file
    • Load from HTTP
    • Load from library
    • Remove triples
    • Clear repository
  • Query
    • YASGUI SPARQL Editor
    • Simple Form
    • SWISH Prolog shell
  • Help
    • Documentation
    • Tutorial
    • Roadmap
    • HTTP Services
  • Login

A.12 library(error): Error generating support
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • The SWI-Prolog library
        • library(error): Error generating support
          • type_error/2
          • domain_error/2
          • existence_error/2
          • permission_error/3
          • instantiation_error/1
          • uninstantiation_error/1
          • representation_error/1
          • syntax_error/1
          • resource_error/1
          • must_be/2
          • is_of_type/2
          • current_type/3
    • Packages
Availability::- use_module(library(error)).(can be autoloaded)
Source[det]must_be(+Type, @Term)
True if Term satisfies the type constraints for Type. Defined types are atom, atomic, between, boolean, callable, chars, codes, text, compound, constant, float, integer, nonneg, positive_integer, negative_integer, nonvar, number, oneof, list, list_or_partial_list, symbol, var, rational, encoding, dict and string.

Most of these types are defined by an arity-1 built-in predicate of the same name. Below is a brief definition of the other types.

booleanone of true or false
charAtom of length 1
codeRepresentation Unicode code point
charsProper list of 1-character atoms
codesProper list of Unicode character codes
textOne of atom, string, chars or codes
between(IntL,IntU) Integer [IntL..IntU]
between(FloatL,FloatU) Number [FloatL..FloatU]
nonnegInteger >= 0
positive_integerInteger > 0
negative_integerInteger < 0
oneof(L) Ground term that is member of L
encodingValid name for a character encoding
cyclicCyclic term (rational tree)
acyclicAcyclic term (tree)
list(Type) Proper list with elements of Type
list_or_partial_listA list or an open list (ending in a variable

Note: The Windows version can only represent Unicode code points up to 2^16-1. Higher values cause a representation error on most text handling predicates.

throws
instantiation_error if Term is insufficiently instantiated and type_error(Type, Term) if Term is not of Type.
ClioPatria (version V3.1.1-21-gb8003bb)