Skip to content
This repository has been archived by the owner on Sep 1, 2020. It is now read-only.

peekiter #65

Merged
merged 1 commit into from
Oct 8, 2016
Merged

peekiter #65

merged 1 commit into from
Oct 8, 2016

Conversation

dfdx
Copy link
Contributor

@dfdx dfdx commented Jun 9, 2016

Iterator wrapper that provides additional operation - peek(iter, state) - that allows to inspect head element without actually changing the iterator state. See #63 for discussion.

@mschauer
Copy link

mschauer commented Jun 10, 2016

Ah, 0.3 has no Nullable type, so this is a 0.4+ only iterator. But I think this can be fixed using @compat.

@dfdx
Copy link
Contributor Author

dfdx commented Jun 10, 2016

using Compat should have already provided Nullable type, so this issue is a little bit trickier. I'll investigate it later today.

@dfdx
Copy link
Contributor Author

dfdx commented Jun 10, 2016

Fixed. Turns out we returned Nullable(Nullable(val)) in peek(..). Julia 0.4 and 0.5 automatically unwrapped it into simpler Nullable(val), so using (not fully compatible) replacement from Compat on 0.3 actually uncovered a bug.

@dfdx dfdx mentioned this pull request Jun 11, 2016
@kmsquire
Copy link
Member

Seems useful. Can you add some documentation to the README?

Unless there is any objection, I'll merge this after it's documented.

@mschauer
Copy link

Not urgent, but what do you think about #63 (comment) making peekiter a noop for ranges?

@dfdx
Copy link
Contributor Author

dfdx commented Jun 14, 2016

@kmsquire Done. Thanks for reminder. It's good to know that changes are being properly checked before merging!

@mschauer Ah, this is definitely a good addition. Should we also do the same thing for Array?

@dfdx
Copy link
Contributor Author

dfdx commented Jul 3, 2016

If there are no more suggestions, could someone merge it, please?

@iamed2 iamed2 merged commit c3f0692 into JuliaCollections:master Oct 8, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants