It depends on the particular enumerable. Of course, the array will always be repeated in the obvious order.
It would be really crazy for someone to implement the each method, which will go through the same collection differently, but the only actual limitation for such a “function” will be in the documentation for the class that mixes in enumerations. Well, that’s the sanity of the developers.
I can almost imagine some kind of cryptographic API that deliberately crossed the collection in an unpredictable way.
Digitaloss
source share