Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :- nb_setval('$my_handler',[h(Ex,$throw(Ex)])).
- throw(E):- b_getval('$ex_handler',List),member(h(E,H),List), H , $next_instruction.
- catch(G,E,H):-
- b_getval('$ex_handler',Previous),
- b_setval('$ex_handler',[h(E,H)|Previous]),
- G,
- label_next:
- nb_setval('$ex_handler',Previous).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement