Closed nsensfel closed 3 years ago
Reason for it not being implemented currently: the number of parameters is determined during compilation times, so a list with a size determined during runtime cannot be used as-is.
Potential solution: in wyrd, store parameters in wild dict. Number them in reverse: if the function has 3 parameters, store the first one in param_2, the second in param_1, etc... Thus, if this turned out to be an already partially parametered lambda, the previous parameters are in param_3, param_4, etc... This wild dict has to be what is passed around in addition to the instruction line.
I don't remember why this wasn't implemented to start with.
This should be doable by having Wyrd consider lambda values as a pair with one element being the line for the lambda function and the other being the list of arguments that are already assigned.
Considering how this would change pretty much every existing computations and instructions that support lambda expressions, this should be included in the next release candidate.