Joseph Ferano
2d8d9cd5a8
dotimes counts from where you say, and can count down
...
"Is there a way to do dotimes or a loop in reverse?" — the answer was a
hand-written let plus set. Now it is (dotimes [i 9 -1 -1]).
Three arities: [i n], [i start stop], [i start stop step]. The stop is
exclusive in all of them, so [i 0 n] is [i n] — one rule, not two — and a
negative step counts down, testing with > instead of <.
A literal step of 0 is refused where it is written. One that is only a value
cannot be, so the condition asks the sign first and 0 falls out of it as a
loop that runs no times: terminating and deterministic, and free, because a
literal step still emits the single comparison it always did.
Each bound is evaluated once, left to right, before the counter exists: the
start into the counter, the stop into the hidden slot it always had, the
step into one of its own unless it is a literal.
Still a special form, still a Let and a While with the step in the latch, so
neither backend learned anything — the new program prints the same thing
under --x86 and at -O0. load.ml's Form-level walk had to learn more than one
bound for the same reason parse.ml did; it is part of this feature and not a
bug that was sitting there, because before this a three-bound dotimes was a
parse error long before that walk could reach it.
2026-09-21 08:09:53 +07:00
..
2026-09-19 06:41:57 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-12 14:47:54 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-20 20:10:39 +07:00
2026-09-21 07:12:04 +07:00
2026-09-20 23:12:42 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-12 14:47:54 +07:00
2026-09-20 20:17:17 +07:00
2026-09-20 23:12:42 +07:00
2026-09-21 07:19:33 +07:00
2026-09-20 23:12:42 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-17 19:03:27 +07:00
2026-09-12 14:47:54 +07:00
2026-09-12 14:47:54 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-20 15:36:13 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-20 20:10:39 +07:00
2026-09-13 17:55:00 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:30:57 +07:00
2026-09-21 07:12:04 +07:00
2026-09-20 23:12:42 +07:00
2026-09-18 13:47:42 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 08:09:53 +07:00
2026-09-19 05:55:48 +07:00
2026-09-21 07:12:04 +07:00
2026-09-20 13:54:07 +07:00
2026-09-20 15:36:27 +07:00
2026-09-19 06:40:53 +07:00
2026-09-21 07:12:04 +07:00
2026-09-19 05:52:47 +07:00
2026-09-20 10:36:05 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-20 18:46:48 +07:00
2026-09-19 06:06:44 +07:00
2026-09-21 07:12:04 +07:00
2026-09-20 23:12:42 +07:00
2026-09-21 07:12:04 +07:00
2026-09-20 23:12:42 +07:00
2026-09-20 19:30:04 +07:00
2026-09-12 14:47:54 +07:00
2026-09-12 09:11:34 +07:00
2026-09-12 14:47:54 +07:00
2026-09-12 11:07:57 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-12 22:44:33 +07:00
2026-09-12 22:44:33 +07:00
2026-09-12 22:44:33 +07:00
2026-09-12 22:44:33 +07:00
2026-09-21 07:12:04 +07:00
2026-09-20 23:12:42 +07:00
2026-09-21 07:12:04 +07:00
2026-09-12 11:15:58 +07:00
2026-09-13 15:23:37 +07:00
2026-09-13 14:49:11 +07:00
2026-09-18 12:16:05 +07:00
2026-09-20 23:12:42 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-19 05:21:02 +07:00
2026-09-20 20:17:17 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-20 23:12:42 +07:00
2026-09-21 07:12:04 +07:00
2026-09-20 18:02:59 +07:00
2026-09-12 22:00:13 +07:00
2026-09-21 07:12:04 +07:00
2026-09-20 18:18:24 +07:00
2026-09-20 18:18:24 +07:00
2026-09-20 18:18:24 +07:00
2026-09-20 18:18:24 +07:00
2026-09-20 18:18:24 +07:00
2026-09-20 18:18:24 +07:00
2026-09-20 18:18:24 +07:00
2026-09-12 23:18:28 +07:00
2026-09-20 18:23:22 +07:00
2026-09-21 07:12:04 +07:00
2026-09-19 05:21:02 +07:00
2026-09-19 05:21:02 +07:00
2026-09-12 16:09:27 +07:00
2026-09-12 16:34:25 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-12 23:06:40 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-12 16:46:30 +07:00
2026-09-12 16:46:30 +07:00
2026-09-21 07:12:04 +07:00
2026-09-12 16:46:30 +07:00
2026-09-20 21:00:22 +07:00
2026-09-20 21:00:22 +07:00
2026-09-11 20:11:01 +07:00
2026-09-13 15:40:08 +07:00
2026-09-13 17:54:36 +07:00
2026-09-13 15:40:08 +07:00
2026-09-13 15:40:08 +07:00
2026-09-20 18:18:24 +07:00
2026-09-20 23:12:42 +07:00
2026-09-12 10:40:47 +07:00
2026-09-12 05:32:25 +07:00
2026-09-11 20:11:01 +07:00
2026-09-11 20:11:01 +07:00
2026-09-12 05:32:25 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:19:33 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-13 07:50:03 +07:00
2026-09-21 07:12:04 +07:00
2026-09-13 23:22:37 +07:00
2026-09-13 07:50:03 +07:00
2026-09-12 16:09:48 +07:00
2026-09-21 07:12:04 +07:00
2026-09-13 09:32:58 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:30:57 +07:00
2026-09-21 07:12:04 +07:00
2026-09-17 21:49:40 +07:00
2026-09-21 07:12:04 +07:00
2026-09-20 18:18:20 +07:00
2026-09-20 18:18:20 +07:00
2026-09-13 18:00:35 +07:00
2026-09-13 18:00:35 +07:00
2026-09-12 05:32:25 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-17 22:17:19 +07:00
2026-09-12 05:32:25 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-12 11:38:24 +07:00
2026-09-21 07:12:04 +07:00
2026-09-20 07:20:27 +07:00
2026-09-12 11:07:57 +07:00
2026-09-20 23:12:42 +07:00
2026-09-20 23:12:42 +07:00
2026-09-20 23:12:42 +07:00
2026-09-20 18:12:45 +07:00
2026-09-20 23:12:42 +07:00
2026-09-20 11:53:37 +07:00
2026-09-17 22:55:30 +07:00
2026-09-21 07:12:04 +07:00
2026-09-12 23:18:28 +07:00
2026-09-12 11:15:58 +07:00
2026-09-21 07:12:04 +07:00
2026-09-21 07:12:04 +07:00
2026-09-12 11:07:57 +07:00
2026-09-21 07:12:04 +07:00
2026-09-18 12:16:05 +07:00
2026-09-12 11:07:57 +07:00
2026-09-12 11:07:57 +07:00
2026-09-12 11:12:49 +07:00
2026-09-12 11:07:57 +07:00
2026-09-12 14:47:54 +07:00
2026-09-20 23:12:42 +07:00
2026-09-20 23:12:42 +07:00
2026-09-21 07:12:04 +07:00