Re: [julia-users] collecting multiple vectors from infinite iterator

2016-10-12 Thread Mauro
Somewhat off topic, as you seem to be dealing with ragged arrays. Are you aware of https://github.com/mbauman/RaggedArrays.jl ? Also there are references to other, older implementations: https://github.com/mbauman/RaggedArrays.jl/issues/2 On Wed, 2016-10-12 at 16:16, Tamas Papp wrote: > For exa

[julia-users] collecting multiple vectors from infinite iterator

2016-10-12 Thread Tamas Papp
For example, I want collect_ragged(countfrom(1), [2,3,4]) to return 3-element Array{Any,1}: [1,2] [3,4,5] [6,7,8,9] I implemented it as function collect_ragged(iterator, lengths) result = Vector(length(lengths)) s = start(iterator) for (i,l) in enumerate(lengths) v