YAP 7.1.0
Error generating type-checking

This code is based oon the SWI predicates to simplify error generation and checking. More...

Detailed Description

This code is based oon the SWI predicates to simplify error generation and checking.

Adapted to use YAP built-ins

Its implementation is based on a discussion on the SWI-Prolog mailinglist on best practices in error handling The utility predicate must_be/2 provides simple run-time type validation The *_error predicates are simple wrappers around throw/1 to simplify throwing the most common ISO error terms

YAP reuses the code with some extensions, and supports interfacing to some C-builtins


Class Documentation

◆ type_error/2

class type_error/2

type_error(+Type, +Term)

%%

◆ domain_error/3

class domain_error/3

domain_error(+Type, +Value, +Term)

%%

◆ existence_error/2

class existence_error/2

existence_error(+Type, +Term)

%%

◆ permission_error/3

class permission_error/3

permission_error(+Action, +Type, +Term)

%%

◆ instantiation_error/1

class instantiation_error/1

instantiation_error(+Term)

%%

◆ representation_error/1

class representation_error/1

representation_error(+Reason)

% % Throw ISO compliant error messages

◆ is_not/2

class is_not/2

is_not(+Type, @Term)

% % Throws appropriate error It is known that Term is not of type % Type % %

Exceptions
type_error(Type,Term)%
instantiation_error