Write a function that duplicates every element in a list. For instance: {Duplicate [1 2 3]} returns the list [1 1 2 2 3 3].
How can I make it in OZ mozart? I don't know the sintaxis of oz, in prolog would be something like:
even(N) :-
N mod 2 =:= 0.
doubleeven([],[]).
doubleeven([H|T], [H,H|Z]) :-
even(H),
!,
doubleeven(T,Z).
doubleeven([H|T], [H|Z]) :-
doubleeven(T,Z).