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

Iterated followed by TakeWhile iterates more than it should #550

Open
dimchee opened this issue Jan 22, 2023 · 0 comments
Open

Iterated followed by TakeWhile iterates more than it should #550

dimchee opened this issue Jan 22, 2023 · 0 comments

Comments

@dimchee
Copy link

dimchee commented Jan 22, 2023

I tried using TakeWhile after Iterated, but Iterated function argument seems to be executed before condition of TakeWhile. Is this intentional?

julia> 1:10 |> Iterated(x -> (println("called with: $x"); x+1), 0) |> TakeWhile(x -> x < 3) |> collect
called with: 0
called with: 1
called with: 2
called with: 3
3-element Vector{Int64}:
 0
 1
 2
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

No branches or pull requests

1 participant