roc icon indicating copy to clipboard operation
roc copied to clipboard

`List.range` is neither inclusive nor exclusive

Open shritesh opened this issue 2 years ago • 1 comments

According to the doc it Returns a list of all the integers between one and another, including both of the given numbers. aka an inclusive range, but in practice:

» List.range 1 1

[1] : List (Int *)

» List.range 1 2

[1] : List (Int *)

» List.range 1 3

[1, 2] : List (Int *)

In the first invocation, it returns an inclusive range, but for the second and third, it returns an exclusive range.

shritesh avatar Oct 04 '22 14:10 shritesh

Just going to point this is to #4169 as well. It is about changing the List.range api as a whole. So they might fit well as a PR together.

bhansconnect avatar Oct 04 '22 15:10 bhansconnect