kachayev/fn.py

Alternative tail-call optimisation decorator

keleshev opened this issue · 2 comments

There is an interesting implementation of tail-call optimisation decorator, which could be provided as an alternative to fn.recur.tco:

http://code.activestate.com/recipes/474088-tail-call-optimization-decorator/

It allows for more readable code, but has a speed penalty because it is implemented by raising exception on each recursion.

+1 for this. BTW, is this project dead?

@halst Personally I don't like any manual manipulation with _getframe etc. It always leads to magically fragile side-effects that's hard to find/debug/interop.