%mathpiper,def="Reverse"

// Non-destructive Reverse operation
Reverse(list):=DestructiveReverse(FlatCopy(list));

%/mathpiper



%mathpiper_docs,name="Reverse",categories="User Functions;Lists (Operations)"
*CMD Reverse --- return the reversed list (without touching the original)
*STD
*CALL
	Reverse(list)

*PARMS

{list} -- list to reverse

*DESC

This function returns a list reversed, without changing the
original list. It is similar to {DestructiveReverse}, but safer
and slower.


*E.G.

In> lst:={a,b,c,13,19}
Result: {a,b,c,13,19};
In> revlst:=Reverse(lst)
Result: {19,13,c,b,a};
In> lst
Result: {a,b,c,13,19};

*SEE FlatCopy, DestructiveReverse
%/mathpiper_docs