Order of objects in a Set - stable?

I noticed Xojo now has a Set class, with a bunch of useful operators.

Does anyone know if the order of the variants in a Set is stable when (for example) objects are added, removed or popped from the Set ? I’ve long known this is an issue with Dictionaries - the order can change if a key-value pair is removed.

Not documented, so not reliable.
Usually sets are used to obtain a specific list of data, adding and subtracting subset, and the final order of such mess is not important; if it is, you should sort it. Much like SQL, you ask for a SELECT and will receive a set of data, and it may be a messed order, and if want it ordered, you should add another operation on top of it, an ORDER BY (that can take advantage of indexes or fire a slow sort after).


Like a Dictionary, order is not guaranteed.

1 Like

OK thanks. I’ll build my own “Set” and “Collection” classes.