Question: duplicates being eliminated from a list

I have a procedure:

duplicates := proc(L)
local newL,vals,T;
vals := {[1/2,1/4,3/4]};
for T in L do
if not (T([1/2,1/4,3/4]) in vals) then
vals := vals union { T([1/2,1/4,3/4]) };
newL := [newL[],T]
end if
end do;
return newL
end proc:

This procedure is being used to eliminate duplicates on a list, by having originally three elements and going through the List in a loop and if the element is not already in the elements of the list, they are added on.

However, I want to try and rewrite this procedure. I want to do it almost the opposite way around saying for all elements in L in a list, for T in L do, if T is already in the List then remove from output.

However I am not sure how to go about this and was hoping someone could give me advice on how to do it, or even simply which maple commands I can use so that I can start it.




Please Wait...