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

zips, products and takes with infinite components #15400

Merged
merged 2 commits into from
Mar 11, 2016

Conversation

mschauer
Copy link
Contributor

@mschauer mschauer commented Mar 8, 2016

This is #13276 using the iterator traits of #15146 (now hopefully rebased).

@JeffBezanson
Copy link
Member

👍

Could we have similar definitions for take and drop?

@mschauer
Copy link
Contributor Author

I added similar definitions for take and drop.

@mschauer
Copy link
Contributor Author

Btw, is there a conceivable situation case where Rest does not inherit the size trait of its iterator?


_diff_length(a, b, A, ::IsInfinite) = 0
_diff_length(a, b, ::IsInfinite, ::IsInfinite) = 0
_diff_length(a, b, ::IsInfinite, B) = length(b) # inherit behaviour, error
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this call length(a) instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes!

JeffBezanson added a commit that referenced this pull request Mar 11, 2016
zips, products and takes with infinite components
@JeffBezanson JeffBezanson merged commit 6d8191b into JuliaLang:jb/itertraits Mar 11, 2016
@JeffBezanson
Copy link
Member

The problem with Rest is that there's no standard way to determine the length of an iterable starting at a given state, so for now it has to be unknown most of the time.

@mschauer mschauer deleted the isinfinite2 branch May 24, 2016 18:14
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 this pull request may close these issues.

2 participants