range(start, end, @key next = inc, compare = number_is_lteq)
Return a list of values from start
to end
(both inclusive).
Next
must be a function that when called with the current element added to the result, return the following element.
Compare
is the predicate used to determine when to stop generating new elements.
range(1, 10)
// [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
range(\a, \k, next = ^(c) integer_to_char(char_to_integer(c) + 2), compare = char_is_lteq)
// [\a, \c, \e, \g, \i, \k]