Guest User

Untitled

a guest
Feb 21st, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. wrapper(L,Args):-
  2. catch(one_more_wrap(L,Args),_,send(L,false)).
  3.  
  4. one_more_wrap(L,Args):-
  5. real_predicate(Args,Result),
  6. send(L,[true,result]).
  7.  
  8.  
  9. % of course you can avoid the second wrap if you add the send to the real predicate:
  10. % real predicate = foo
  11.  
  12. foo(L,X,Result):-
  13. X>0,
  14. Result=42,
  15. send(L, [true,42]).
Add Comment
Please, Sign In to add comment