I’m beginning to wonder whether a language that doesn’t have indexes at all would be viable.
Swift abandoned C-style for loops (https://github.com/apple/swift-evolution/blob/main/proposals...)
It still has enumerated (https://developer.apple.com/documentation/swift/sequence/enu...()), though.
That’s a special case of zip, though, and programs could use
zip(items, 0...Int.max)
zip(items, 1...Int.max)
Also, slices could be created using
items.subrange( skip: 3, take: 5)
items.subrange( startIndex: 3, numItems: 5)
I’m beginning to wonder whether a language that doesn’t have indexes at all would be viable.
Swift abandoned C-style for loops (https://github.com/apple/swift-evolution/blob/main/proposals...)
It still has enumerated (https://developer.apple.com/documentation/swift/sequence/enu...()), though.
That’s a special case of zip, though, and programs could use
or according to their preference.Also, slices could be created using
instead of Implementation-wise, those are identical, but conceptually, the first doesn’t use indexes