fork(5) download
  1. pares([], []).
  2. pares([X|Xs], L) :- X mod 2 =:= 0, pares(Xs, Laux), append([X], Laux, L).
  3. pares([X|Xs], L) :- X mod 2 =\= 0, pares(Xs, Laux), L = Laux.
  4.  
  5. ?- pares([1,2,3,4], L), write(L).
Success #stdin #stdout #stderr 0.04s 7872KB
stdin
Standard input is empty
stdout
[2,4]
stderr
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit