Using the iteration interface with custom indices

I see that I reversed the arguments in

Base.iterate(I::CustomIndexSet) = 1,CustomIndex(1)

I got confused by the description in the manual of iterate:

Returns either a tuple of the first item and initial state or nothing if empty

“Item” and “state” seem interchangeable and ambiguous.

1 Like