Forum Discussion
Legacy EVALUATE in LAMBDA: Build/Test LAMBDAs from Sheet
I tried to play with some of your ideas but it may be that EVALUATE has some limitations when applied to modern dynamic arrays.
- tbouldenFeb 20, 2021Iron Contributor
PeterBartholomew1In researching this further, I've covered territory that you and lori_m were traversing prior to the implementation of dynamic arrays: de-referencing and coercion! Due to the primordial nature of EVALUATE, these results would previously have required CSE I think, so we have to provide some incentive at times for it to give us what we want. Please see attached! I'm glad this is a thing of the past, but it is very interesting to learn about, kind of like working on your own car.
- PeterBartholomew1Feb 20, 2021Silver Contributor
Well done. I was sure I had tried the old
N(IF(1,arr))
formula in the INDEX but clearly I got something wrong.
I decided that, if I wasn't allowed 'n' as a formula-local name, I would switch to Unicode symbols.
One perfectly legal Lambda that I amused myself with recently was
= √(x²+y²)
- tbouldenFeb 21, 2021Iron Contributor
PeterBartholomew1I'm afraid I'm not picking up your comment re: the hypoteneuse LAMBDA, perhaps I'm dense?
I've got another bit of troubleshooting I might like your help with, if you'll indulge me. As originally stated in the thread subject, I'm trying to refine using EVALUATE to make a nice worksheet-based "environment" for testing LET/LAMBDAs during construction. I've recently tried putting together your FOREACH and XSTACK in this "environment" and run into trouble with FOREACH, particularly passing in a function as a parameter. If doing so with LET and EVAL, it works happily; for LAMBDA I'm extremely confused. I can pass in the Name Manager-based LAMBDA (Iterate, in this example) and the following construction returns "128" as expected:
=EVAL(LAMBDA(function,TYPE(function)))
However, if I try to apply function as in the following:
=EVAL(LAMBDA(function,function(1)))
I'm given #NAME?. Please see attached for more detail, and thanks in advance!
- tbouldenFeb 16, 2021Iron Contributor
PeterBartholomew1You're onto something; I tried unpacking your LET function using my previous UnpackLet LAMBDA and that formula works, but EVAL of that formula yields same result as your EVAL("LET..."), being the first value in the 1-d array. Will play with it some more as well; not ready to throw it out just yet, and the more limitations we're aware of will prevent unnecessary frustration. Thanks!!