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

peekiter#65

Merged
iamed2 merged 1 commit into
JuliaCollections:masterfrom
dfdx:peekiter
Oct 8, 2016
Merged

peekiter#65
iamed2 merged 1 commit into
JuliaCollections:masterfrom
dfdx:peekiter

Conversation

@dfdx

@dfdx dfdx commented Jun 9, 2016

Copy link
Copy Markdown
Contributor

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

mschauer commented Jun 10, 2016

Copy link
Copy Markdown

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

dfdx commented Jun 10, 2016

Copy link
Copy Markdown
Contributor Author

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

@dfdx

dfdx commented Jun 10, 2016

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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
Copy Markdown

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

@dfdx

dfdx commented Jun 14, 2016

Copy link
Copy Markdown
Contributor Author

@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

dfdx commented Jul 3, 2016

Copy link
Copy Markdown
Contributor Author

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