Implementing recursive lambda with MethodHandle
John Rose
John.Rose at Sun.COM
Mon Feb 22 10:35:32 PST 2010
On Feb 22, 2010, at 3:52 AM, Rémi Forax wrote:
> Rather ugly, isn't it ?
Yes, but it is totally standard for such things. Self-recursion of functions requires some sort of uplevel patchable self-reference, whether via an object or an array. Lisp dialects do such things routinely for (mutually) recursive functions. I assume more modern functional languages do something similar to "close the loop".
This technique, strong and ugly, scales naturally to important use case of *several* mutually recursive local functions (LETREC, LET/DEFINE, etc.).
-- John
More information about the lambda-dev
mailing list