: dip swap '_ set execute _ ; : remove-duplicates [] swap do unique? length 0 == if break then loop drop ; : unique? 0 extract swap "2dup in if drop else append then" dip ; [1 2 6 3 6 4 5 6] remove-duplicates .