Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
user51442
· 9y ago · 0 comments
Well, the optimizations are pretty smart to be sure, the stupid thing is that anything over 12! overflows (as GlitchMr points out).
I'd like to know how the recursion to iteration step was done.
Comments
[–]
eutectic
9y ago
Presumably there is a pass to turn f(recur(x), y) into recur(f(y, acc), x) and then tail-call optimization can be applied. This works for any associative f.