Sets are based on dictionaries (just the keys no values) and in their
current implementation the insertion order is not preserved.

There are oredered Sets in https://github.com/JuliaLang/DataStructures.jl

On Wed, 2015-09-16 at 22:52, Michela Di Lullo <michela.dilu...@uniroma1.it> 
wrote:
> Hello everyone, 
>
> does someone know why when I create a set, (sometimes) it automatically 
> re-orders the elements in it? 
> in example, if I have: 
>
> *vector1=[1,2]*
> *vector2=[3,4]*
> *vector3=[5,6]*
> *vector4=[7,8]*
>
> *vector=Set({vector1, vector2, vector3, vector4})*
>
> Set{Any}({[7,8],[1,2],[3,4],[5,6]})
>
> *for i in vector*
>
> *       @show i      *
>
> * end*
>
> i => [7,8]
>
> i => [1,2]
>
> i => [3,4]
>
> i => [5,6]
>
>
> How could I force it not to re-order the elements in the set? 
>
>
> Thank you in advance for any information,
>
>
> Michela 

Reply via email to