Introduce 'step' property in progressions instead of 'increment'

This commit is contained in:
Ilya Gorbunov
2015-11-26 23:43:31 +03:00
parent b8d0685b71
commit 661e288362
10 changed files with 309 additions and 226 deletions
@@ -24,7 +24,7 @@ fun ranges(): List<GenericFunction> {
"return TProgression.fromClosedRange(last, first, -ONE)"
}
body(ProgressionsOfPrimitives) {
"return TProgression.fromClosedRange(last, first, -increment)"
"return TProgression.fromClosedRange(last, first, -step)"
}
}
@@ -41,7 +41,7 @@ fun ranges(): List<GenericFunction> {
"return TProgression.fromClosedRange(last, first, -ONE)"
}
body(ProgressionsOfPrimitives) {
"return TProgression.fromClosedRange(last, first, -increment)"
"return TProgression.fromClosedRange(last, first, -step)"
}
}
@@ -63,7 +63,7 @@ fun ranges(): List<GenericFunction> {
body(ProgressionsOfPrimitives) {
"""
checkStepIsPositive(step > 0, step)
return TProgression.fromClosedRange(first, last, if (increment > 0) step else -step)
return TProgression.fromClosedRange(first, last, if (this.step > 0) step else -step)
"""
}
}
@@ -95,7 +95,7 @@ fun ranges(): List<GenericFunction> {
body(ProgressionsOfPrimitives) {
"""
checkStepIsPositive(step > 0, step)
return TProgression.fromClosedRange(first, last, if (increment > 0) step else -step)
return TProgression.fromClosedRange(first, last, if (this.step > 0) step else -step)
"""
}
}
@@ -113,7 +113,7 @@ fun ranges(): List<GenericFunction> {
doc {
"""
Returns a progression from this value down to the specified [to] value with the increment -1.
Returns a progression from this value down to the specified [to] value with the step -1.
The [to] value has to be less than this value.
"""
}