Closed ta0kira closed 2 years ago
Rather than adding a bunch of named functions for different combinations, maybe it could use a builder, e.g.,
traverse (Counter.build().start(0).count(5).by(2) -> Int i) {
// 0 2 4 6 8
}
traverse (Counter.build().start(10).finish(15) -> Int i) {
// 10 11 12 13 14 15
}
traverse (Counter.build().count(n) -> Int i) {
// same as Counter.zeroIndexed(n)
}
traverse (Counter.build().count(n).reverse() -> Int i) {
// same as Counter.revZeroIndexed(n)
}
Right now it's too error-prone to use
Counter.zeroIndexed
to do ranges and offsets.