The implementation of withoutDuplicates is brilliant.
*withoutDuplicates "Answer a copy of the receiver that preserves order but eliminates any duplicates." | seen | seen := Set new: self size. ^self select: [:each| seen ifAbsentAdd: each]*
The Set acts as a growing "mask" of what is allowed in the OrderedCollection returned by select.
I have never seen this idiom. Truly inspiring.
-- Sent from: http://forum.world.st/Squeak-Beginners-f107673.html