%mathpiper,def="RemoveRepeated"

10 # RemoveRepeated({}) <-- {};
10 # RemoveRepeated({_x}) <-- {x};
20 # RemoveRepeated(list_IsList) <-- [
	Local(i, done);
	done := False;
	For(i:=0, Not done, i++)
	[
		While(i<Length(list) And list[i]=list[i+1])
			DestructiveDelete(list, i);
		If(i=Length(list), done := True);
	];
	list;
];

%/mathpiper