LAMBDA functions and recursion -- calling a SELF function?
I would like to be able to call a lambda recursively on the grid without the name manager. a SELF function could refer to the function being written. Is that possible? Here's an example for factorial,
FACTORIAL: LAMBDA(n, IF(n = 0, 1, n * SELF(n - 1)))
Here's another for matrix exponentiation,
LAMBDA( A, p,
LET does not permit recursion natively but one can define a 'fixed point combinator' to achieve this. A recent Microsoft Research blog entry shows how to implement recursion using only LET and LAMBDA without name manager,
Kenneth Barber commented
Can you do something like this? I don't have the right version of Excel to test this.
LET(FACTORIAL,LAMBDA(n,IF(n=0,1,n*FACTORIAL(n - 1))),FACTORIAL)