I am investigating possible data structures for an application.
Here is an "interesting" behaviour in IntSet, which is no doubt to do with 
the implementation.
Maybe it should just throw an exception if someone tries to add a really 
large integer like this!


julia> s = IntSet()
IntSet()

julia> push!(s, 100000)
IntSet(100000)

julia> sizeof(s)
24

julia> push!(s, 1000000)
IntSet(100000, 1000000)

julia> sizeof(s)
24

julia> push!(s, 10000000)
IntSet(100000, 1000000, 10000000)

julia> push!(s, 100000000)
IntSet(100000, 1000000, 10000000, 100000000)

julia> push!(s, 1000000000)
IntSet(100000, 1000000, 10000000, 100000000, 1000000000)

julia> sizeof(s)
24

julia> push!(s, 10000000000)
IntSet(100000, 1000000, 10000000, 100000000, 1000000000, 1410065408, 
1410065408, 1410065408, 1410065408, 1410065408, 1410065408, 1410065408, 
1410065408, 1410065408, 1410065408, 1410065408, 1410065408, 1410065408, 
1410065408, 1410065408, 1410065408, 1410065408^CEvaluation succeeded, but 
an error occurred while showing value of type IntSet:
ERROR: interrupt
 in show at intset.jl:172
 in anonymous at show.jl:973
 in showlimited at show.jl:972
 in writemime at repl.jl:2
 in display at multimedia.jl:117
 in display at multimedia.jl:119
 in display at multimedia.jl:151

Reply via email to