-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
zip2 and eachline don't play nice because next()
is called twice
#7369
Comments
swadey
added a commit
to swadey/julia
that referenced
this issue
Jun 22, 2014
See also #6284 which I think is related in spirit |
right. It's the same problem but in a different part of |
JeffBezanson
added a commit
that referenced
this issue
Jun 23, 2014
fixed by #7370 |
swadey
added a commit
to swadey/julia
that referenced
this issue
Jun 23, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Suppose you have
test.txt
which contains:Running this code:
Results in this:
This seems wrong and it's caused by the fact that the
next()
method ofEachLine
changes state but it's called twice in Zip2 causing one state to be skipped per iteration:Since
next()
can, in general have side effects, the I'm assuming the iterator protocol requires thatnext()
only be called once per iteration, so I've submitted a corresponding PR #7370 (with the corresponding test). If that's not true, thenEachLine
should be fixed.The text was updated successfully, but these errors were encountered: