How to write my own extension to enable Python-like String indexing?

RangeExpression serves as an abstraction over all the range types in @tera’s example code.

instead of providing overloads for Range, ClosedRange, PartialRangeFrom, PartialRangeUpTo, and PartialRangeThrough, you could just provide one generic RangeExpression method.

1 Like