It would be wonderful if LAMBDA calls, cell contents and defined names could interact with user-defined functions through the C API. This would enable add-ins integration with add-ins developed on top of the C API in .NET (Excel-DNA), Python (PyXLL) or C/C++.
Currently, UDFs registered with the C API get a RegisterId (a number), which can be passed to the xlfUDF call to evaluate the function. The RegisterId of a UDF is returned when the UDF name is used without parentheses, e.g. as "=MYFUNC" in a cell. The combination of the RegisterId and xlUDF call means we are able to write functions like =FINDMIN(MYFUNC) and then evaluate MYFUNC internally in the UDF. However, this only works MYFUNC is a UDF defined with the C API.
For LAMBDA functions to work with this would be great. Then we can have the low-level functional library defined in Python or F#, and the user makes the LAMBDA functions in Excel which are passed to the functional library this way.
Then you could say:
=FINDMIN(LAMBDA(x, x^2))
=FOLD(LAMBDA(x, y, x+y), 0, A1#)
Where FINDMIN and FOLD are low-level UDFs taking LAMBDAs from the sheet as input, and using it in .NET or Pythong. This would be very neat, but needs a little hook through the C API, though it probably does not need any changes (it might even work already!?)
Then as a basic question when interacting with UDFs from the C API:
* What is the data type of a cell or name that contains a LAMBDA, when evaluated from the C API?
* Is there a way to return a lambda from a function? (e.g. could one implement currying in a user-defined function?)
The feature looks neat, but can be super-powered if it interacts in a friendly way with those of us building the extension tools for Excel.