Forum Discussion

AZ89's avatar
AZ89
Copper Contributor
May 08, 2025
Solved

Help Needed with Using Thunks with SCAN

I'm extremely new to the world of Lambda functions and the concept of using Thunks to get around an Array of Array limitations of the SCAN function. The problem I'm trying to solve requires tracking...
  • PeterBartholomew1's avatar
    May 08, 2025

    You were pretty much there

    The changes I made were

    1. to remove the CHOOSE function to simplify the definition of arrays
    2. to avoid the (illegal) use of cell references as LET variables
    3. To simplify the evaluation of the result of the SCAN

    The main issue was the fact that cell addresses are not valid as names within LET.  I have also demonstrated the passing of functions as parameters and included a demonstration of the evaluation of arrays of thunks.  Your formula using REDUCE offers the most effective approach if you only require values returned from the final step.

     

Resources