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

RFC: make CartesianIndex iterable #23982

Closed
wants to merge 2 commits into from
Closed

RFC: make CartesianIndex iterable #23982

wants to merge 2 commits into from

Conversation

darwindarak
Copy link
Contributor

No description provided.

@ararslan ararslan added collections Data structures holding multiple items, e.g. sets needs news A NEWS entry is required for this change needs tests Unit tests are required for this change labels Oct 4, 2017
@timholy
Copy link
Sponsor Member

timholy commented Oct 4, 2017

Thanks! But please see discussion in #23719.

@darwindarak
Copy link
Contributor Author

Oops, didn't see that!

@darwindarak darwindarak closed this Oct 4, 2017
@timholy
Copy link
Sponsor Member

timholy commented Oct 4, 2017

No problem, I think this is at least the third such PR. I'm beginning to wonder if we should do this:

julia> Base.start(::CartesianIndex) = error("I... is deliberately unsupported for CartesianIndex. Use I without the dots or use Tuple(I)...")

julia> for I in CartesianRange(1:5)
           t = (I...)
           @show t
       end
ERROR: I... is deliberately unsupported for CartesianIndex. Use I without the dots or use Tuple(I)...
Stacktrace:
 [1] append_any(::CartesianIndex{1}, ::Vararg{CartesianIndex{1},N} where N) at ./essentials.jl:385
 [2] macro expansion at ./REPL[7]:2 [inlined]
 [3] anonymous at ./<missing>:?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
collections Data structures holding multiple items, e.g. sets needs tests Unit tests are required for this change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants