Fix throw/1 control construct to throw an instantiation error when the argument is not bound
This commit is contained in:
@@ -615,8 +615,12 @@ handle_ball(C, C, R) :-
|
|||||||
handle_ball(_, _, _) :-
|
handle_ball(_, _, _) :-
|
||||||
'$unwind_stack'.
|
'$unwind_stack'.
|
||||||
|
|
||||||
throw(Ball) :- '$set_ball'(Ball), '$unwind_stack'.
|
throw(Ball) :-
|
||||||
|
( var(Ball) ->
|
||||||
|
'$set_ball'(error(instantiation_error,throw/1))
|
||||||
|
; '$set_ball'(Ball)
|
||||||
|
),
|
||||||
|
'$unwind_stack'.
|
||||||
|
|
||||||
:- non_counted_backtracking '$iterate_find_all'/4.
|
:- non_counted_backtracking '$iterate_find_all'/4.
|
||||||
'$iterate_find_all'(Template, Goal, _, LhOffset) :-
|
'$iterate_find_all'(Template, Goal, _, LhOffset) :-
|
||||||
|
|||||||
Reference in New Issue
Block a user