Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zip with infinite list #66

Open
ngphuoc opened this issue Jul 20, 2017 · 1 comment · May be fixed by #130
Open

zip with infinite list #66

ngphuoc opened this issue Jul 20, 2017 · 1 comment · May be fixed by #130

Comments

@ngphuoc
Copy link

ngphuoc commented Jul 20, 2017

Could Lazy.jl overwrite zip to support zip with an infinite list? I tried the following but got an error:

julia> zip(Lazy.range(1),range(1,5)) |> collect
ERROR: StackOverflowError:
 in (::Lazy.##35#36{Int64})() at /home/ngphuoc/.julia/v0.5/Lazy/src/Lazy.jl:92
 in realise!(::Lazy.LazyList) at /home/ngphuoc/.julia/v0.5/Lazy/src/Lazy.jl:78
 in realise(::Lazy.LazyList) at /home/ngphuoc/.julia/v0.5/Lazy/src/Lazy.jl:86
 in length(::Lazy.LazyList) at /home/ngphuoc/.julia/v0.5/Lazy/src/liblazy.jl:69 (repeats 58169 times)
 in _min_length at ./iterator.jl:8 [inlined]
 in length at ./iterator.jl:92 [inlined]
 in _similar_for at ./array.jl:262 [inlined]
 in _collect at ./array.jl:277 [inlined]
 in collect at ./array.jl:273 [inlined]
 in |>(::Base.Zip2{Lazy.LazyList,UnitRange{Int64}}, ::Base.#collect) at ./operators.jl:350
 in eval_user_input(::Any, ::Base.REPL.REPLBackend) at ./REPL.jl:64
 in macro expansion at ./REPL.jl:95 [inlined]
 in (::Base.REPL.##3#4{Base.REPL.REPLBackend})() at ./event.jl:68

@Akaban Akaban linked a pull request Jan 12, 2021 that will close this issue
@Akaban
Copy link

Akaban commented Jan 12, 2021

Hey,

Just came across the same problem and fixed it. The solution was easy.

See #130

@MikeInnes Could you merge it in master? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants