-
-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ADDED: trap/1: aliases for e.g. type_error -> type_error(_,_)
So one does not need to remember the number of arguments.
- Loading branch information
1 parent
21264b8
commit 1d3f462
Showing
1 changed file
with
10 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
Author: Jan Wielemaker | ||
E-mail: [email protected] | ||
WWW: http://www.swi-prolog.org | ||
Copyright (c) 2021-2023, SWI-Prolog Solutions b.v. | ||
Copyright (c) 2021-2024, SWI-Prolog Solutions b.v. | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
@@ -259,9 +259,15 @@ | |
% | ||
% Define short hands for commonly used exceptions. | ||
|
||
trap_alias(det, determinism_error(_Pred, _Declared, _Observed, property)). | ||
trap_alias(=>, existence_error(rule, _)). | ||
|
||
trap_alias(det, determinism_error(_Pred, _Declared, _Observed, property)). | ||
trap_alias(=>, existence_error(rule, _)). | ||
trap_alias(existence_error, existence_error(_,_)). | ||
trap_alias(type_error, type_error(_,_)). | ||
trap_alias(domain_error, domain_error(_,_)). | ||
trap_alias(permission_error, permission_error(_,_,_)). | ||
trap_alias(representation_error, representation_error(_)). | ||
trap_alias(resource_error, resource_error(_)). | ||
trap_alias(syntax_error, syntax_error(_)). | ||
|
||
trapping :- | ||
findall(exception(Name, Term, NotCaught, Caught), | ||
|