Closed jackfirth closed 11 months ago
Saw this code today:
(apply append (for/list ([k (in-list keys)]) (get k)))
I think this gets a little easier to read if it's migrated to use for*/list like this:
for*/list
(for*/list ([k (in-list keys)] [v (in-list (get k))]) v)
This only works for loops where the body is a single expression since the entire body gets shoved into the [v (in-list ...)] clause. It also only works for for/list loops with one clause, though that restriction doesn't apply to for*/list loops.
[v (in-list ...)]
for/list
Saw this code today:
I think this gets a little easier to read if it's migrated to use
for*/list
like this:This only works for loops where the body is a single expression since the entire body gets shoved into the
[v (in-list ...)]
clause. It also only works forfor/list
loops with one clause, though that restriction doesn't apply tofor*/list
loops.