in reply to Re: Syntactic sugar for tail call optimizations
in thread Syntactic sugar for tail call optimizations
especially:
It can be thought of as the redo operator, but for subroutines instead of loops.:)
Actually I once read about recur in a Clojure book and wondered about the advantages to goto &sub
Clearly - and as you demonstrated - there are two:
1. One can use the "usual" call interface f(PARAS) instead of the cumbersome @_=(PARAS);goto &f
2. Memoize can't intercept and cache calls when goto-like constructions are used.
OTOH Sub::Call::Recur relies on XS code... so I think I'd rather prefer to chose between the need of memoization for repeated runs or for speed and stack-sanity of one time runs.
I think if I need both I could still realize my own memoization hash.
Cheers Rolf
|
|---|