block users from catching user balls.

This commit is contained in:
Vitor Santos Costa 2009-04-22 11:32:07 -05:00
parent cf2b399e9a
commit 2f8c9c6b6c
1 changed files with 13 additions and 2 deletions

View File

@ -1147,13 +1147,24 @@ throw(Ball) :-
'$handle_throw'(_, _, _).
'$handle_throw'(C, A, Ball) :-
% reset info
(Ball \== '$abort', C = Ball ->
% reset info
('catch_ball'(Ball, C) ->
'$execute'(A)
;
throw(Ball)
).
'catch_ball'('$abort', _, _) :- !, fail.
% system defined throws should be ignored by used, unless the
% user is hacking away.
'catch_ball'(Ball, V) :-
var(V),
nonvar(Ball),
functor(Ball, Name, _),
atom_codes(Name, [0'$|_]), %'0
!, fail.
'catch_ball'(C, C).
'$run_toplevel_hooks' :-
nb_getval('$break',0),
recorded('$toplevel_hooks',H,_), !,