Forum Discussion
Legacy EVALUATE in LAMBDA: Build/Test LAMBDAs from Sheet
Dunno, I suppose it's to do with exception handling - some other languages also need a terminator of some sort. The TYPE function was used instead of ISERROR because it always returns a single value so can handle array parameters more easily.
I'd be interested to know if there's a workaround for the recursion limits which are quite restrictive at the moment. If Excel doesn't optimise tail recursion something like this might work (though I struggle to get my head around it!)
lori_m PeterBartholomew1 This got me going down a rabbit hole, and I certainly don't imply that I know what I've been doing, but I think it's helping me get my head wrapped around it (slowly).
Based on the links I ended up doing some googling, and this is something I missed skimming the Microsoft https://www.microsoft.com/en-us/research/blog/lambda-the-ultimatae-excel-worksheet-function/ the first time: the GIF shows their construction of the Z/fixed point combinator.
I searched a bit more to find a derivation of the Z combinator, and came across https://thenewobjective.com/types-and-programming-languages/deriving-the-z-combinator#fixed-points-and-combinators, which seemed reasonably "accessible" (obvious scare quotes due to subject material). So I set about trying to step through these constructions in my LET/LAMBDA testing spreadsheet; please see attached. There were a few interim steps that I couldn't figure out how to implement, but ultimately the final "fact_16" is very similar to the "my_fact" I got from the Microsoft gif. I'm going to be getting some textbooks I haven't looked at in 20 years out over the weekend to try and remember the very little I "learned" about lambda calculus to facilitate making sense of this, because its mostly been pattern matching through the exercise.
- lori_mFeb 25, 2021Iron Contributor
Good info, thanks for posting. I'd recommend 'Computerphile' which has some nice videos at a basic level (like mine). After going through some of that material I concluded the modified combinator method I linked to before needs a while loop so wouldn't help with recursion limits.
There's also a 'Funcalc' spreadsheet project that is the basis of some of the Microsoft Research material, details of which can be found here. It does look like Excel is heading toward a fully fledged functional programming language!