Re: [julia-users] elements' ordering in a set

2015-09-17 Thread Mauro
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 wrote: > Hello everyone, > > does someone k

Re: [julia-users] elements' ordering in a set

2015-09-16 Thread Tom Breloff
Either use arrays, or you could check out OrderedSet from DataStructures.jl. On Wed, Sep 16, 2015 at 4:52 PM, 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 e

[julia-users] elements' ordering in a set

2015-09-16 Thread Michela Di Lullo
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]})