ins_tail([], N, [N]).ins_tail([H|T], N, [H|R]) :- ins_tail(T, N, R). :- ins_tail([1, 2, 3], 4, X), write(X), nl.
Standard input is empty
[1,2,3,4]
ERROR: '$runtoplevel'/0: Undefined procedure: program/0 Exception: (3) program ? EOF: exit
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!