[julia-users] Iteration over a Set where elements may be deleted in the process -- bug?

2014-02-27 Thread David P. Sanders
I need to iterate over a Set whose elements will be deleted in the process. However, some deleted elements are included in the iteration, e.g. the element 4 in the code below. Is this a bug, or am I misunderstanding? Thanks. julia s = Set(5, 3, 4, 6) Set{Int64}({5,4,6,3}) julia for i in s

[julia-users] Iteration over a Set where elements may be deleted in the process -- bug?

2014-02-27 Thread Kevin Squire
One fix would be to use the immutable Set type in the FunctionalCollections.jl package. Cheers, Kevin On Thursday, February 27, 2014, Mauro mauro...@runbox.comjavascript:_e(%7B%7D,'cvml','mauro...@runbox.com'); wrote: In Python it's bad to insert/delete items as well. And people do get

Re: [julia-users] Iteration over a Set where elements may be deleted in the process -- bug?

2014-02-27 Thread Jameson Nash
Some interactive protocols allow deleting the last selected item. Although this can have a side effect of invalidating all other iterators on the same object so it is not pure. On Thursday, February 27, 2014, Kevin Squire kevin.squ...@gmail.com wrote: One fix would be to use the immutable Set