Closed primo-ppcg closed 12 months ago
Tried it out with the usual set of tests and no issues were detected :+1:
...and some manual trials (edited for readability):
$ ./build/janet
Janet 1.30.0-2f43cb84 linux/x64/gcc - '(doc)' for help
repl:1:> (seq [i :range [0 10]] i)
@[0 1 2 3 4 5 6 7 8 9]
repl:2:> (seq [i :range [10]] i)
@[0 1 2 3 4 5 6 7 8 9]
repl:3:> (seq [i :range-to [10]] i)
@[0 1 2 3 4 5 6 7 8 9 10]
repl:4:> (seq [i :down [10]] i)
@[10 9 8 7 6 5 4 3 2 1]
repl:5:> (seq [i :down-to [10]] i)
@[10 9 8 7 6 5 4 3 2 1 0]
Having tried out the down
ones, I did find myself pausing for a moment about their meanings. I understand about the symmetry angle, just giving some impressions here :)
Related: #1275
Makes
:range
more predictable, in particular that:is equivalent to:
rather than producing an infinite loop.
This is consistent with the behavior that the following forms:
are also equivalent.