Skip to content

Commit

Permalink
Add error/2, re issue #352
Browse files Browse the repository at this point in the history
  • Loading branch information
infradig committed Sep 28, 2023
1 parent 94eb8ef commit 02e1883
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions library/builtins.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
resource_error(Resource, Context) :-
throw(error(resource_error(Resource), Context)).

error(Err, Impl) :-
must_be(Err, atom, error/2, _),
F =.. [Err, Impl],
throw(F).

predicate_property(P, A) :-
nonvar(P), atom(A), !,
must_be(P, callable, predicate_property/2, _),
Expand Down

0 comments on commit 02e1883

Please sign in to comment.