Logo

Programming-Idioms

  • Smalltalk
  • Kotlin
x intersection: x asSet.

Preserves order in some Smalltalks (not in Pharo)
x asSet.

Does not preserve ordering.
x = x.distinct()

Ordering is preserved
x = x.toSet().toList()

original ordering is not preserved
(distinct x)

New implementation...
< >
programming-idioms.org