[swift-evolution] [swigt-evolution] [Pitch] Make NSOrderedSet behave like any other collections from Foundation

Remy Demarest psycho.hedgehog at me.com
Fri Jun 17 07:33:36 CDT 2016


Hello everyone,

Unlike its companion collections like NSArray, NSDictionary, and NSSet, NSOrdered is still a class rather than a struct and has a subclass that is still NSMutableOrderedSet. This should probably receive the same treatment as the other classes, namely:

- Use value semantic
- Use generics
- Keep the original NSOrderedSet class and its subclass NSMutableOrderedSet and bridge the two.

struct OrderedSet<Element : Hashable> : SetAlgebra, Hashable, Collection, ArrayLiteralConvertible

This would add an ordered set type to Swift and fits nicely into the existing set of collections and classes moved from Foundation.


More information about the swift-evolution mailing list