RosettaCodeData/Task/Remove-duplicate-elements/AppleScript/remove-duplicate-elements.applescript

10 lines
190 B
AppleScript
Raw Normal View History

2013-04-10 23:57:08 -07:00
unique({1, 2, 3, "a", "b", "c", 2, 3, 4, "b", "c", "d"})
on unique(x)
set R to {}
repeat with i in x
if i is not in R then set end of R to i's contents
end repeat
return R
end unique