fork(4) download
  1. ins_tail([], N, [N]).
  2. ins_tail([H|T], N, [H|R]) :- ins_tail(T, N, R).
  3.  
  4. :- ins_tail([1, 2, 3], 4, X), write(X), nl.
Success #stdin #stdout #stderr 0.02s 7784KB
stdin
Standard input is empty
stdout
[1,2,3,4]
stderr
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit