Actually not: any RangeExpression where Bound == C.Index
represents a contiguous region of a Collection
. That includes, for example, ClosedRange
.
Technicalities aside, even if the claim were true, it would support the name regions
. Method names should reflect semantics, not types. I don't think ranges
reflects semantics particularly well, but even if it did, it would be at a disadvantage. When you read it, you don't know whether the author's intention is to refer to the type, or to the more general meaning of the word. Sometimes you just can't avoid using the same word as an involved type name, no matter how you try, but if you can reflect semantics well with another word, that's almost always the better choice.
IMO-ly y'rs,
Dave