remove-duplicates

Returns a sequence without duplicates.

test is the function used to determine whether one element is a duplicate of another.  The test argument may be non-commutative; it will always be called with its arguments in the same order as they appear in source-sequence.

The result-sequence may or may not be freshly allocated.  However, the source-sequence will not be modified by this operation.

remove-duplicates (#("spam", "eggs", "spam",
"sausage", "spam", "spam"),
test: \=)
⇒ #("spam", "eggs", "sausage")
or
⇒ #("eggs", "spam", "sausage")
or
⇒ #("eggs", "sausage", "spam")

Exported from

Modifiers

open

Arguments

source-sequenceAn instance of <sequence>.
test:An instance of <function>.  The default is ==.

Values

result-sequenceAn instance of <sequence>.
The common-dylan module.
Whenever possible, we have tried to keep the Dylan module pristine and unextended, preferring to add our extensions to separate modules or libraries.
The class of collections whose keys are consecutive integers starting from zero.
The class of objects that can be applied to arguments.
Compares two objects for identity.