Advertisement
logicmoo

Maplist helpers

Oct 18th, 2015
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 0.63 KB | None | 0 0
  1. :- meta_predicate
  2.     include_(+, 1, -),
  3.     exclude_(+, 1, -),
  4.     partition_(+, -, -, 1),
  5.     partition_(+, -, -, -, 2),
  6.     maplist_(?, 1),
  7.     maplist_(?, ?, 2),
  8.     maplist_(?, ?, ?, 3),
  9.     maplist_(?, ?, ?, ?, 4),
  10.     foldl_(+, +, 3, -),
  11.     foldl_(+, +, +, 4, -),
  12.     foldl_(+, +, +, +, 5, -),
  13.     foldl_(+, +, +, +, +, 6, -),
  14.     scanl_(+, +, 3, -),
  15.     scanl_(+, +, +, 4, -),
  16.     scanl_(+, +, +, +, 5, -),
  17.     scanl_(+, +, +, +, +, 6, -).
  18.  
  19.  
  20. :- meta_predicate my_module_sensitive_code(?).
  21. my_module_sensitive_code(_E):- context_module(CM),writeln(context_module=CM).
  22.  
  23. ?- maplist(my_module_sensitive_code,[1,2]),fail.
  24. context_module=apply.
  25. context_module=apply.
  26. No.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement