Consider increasing the masochism factor by adding support for `:let`/`:while`/`:when` to `loopr`
p-himik opened this issue · 0 comments
p-himik commented
Currently I'm using net.cgrand.xforms/for
for it, but feels like it has a bit more overhead than loopr
would if it had support for those for
sugary bits.
A slightly changed example from the docstring as a brief illustration.
(loopr [count 0
sum 0]
[f (range 10)
:when (even? f)
row [[1 2 3] [4 5 6] [7 8 9]]
:let [column (mapv inc row)]
x row
y column]
(recur (inc count) (+ sum (* f x y)))
(/ sum count))