lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

As well the given examples are not pure lambda:

or its transformation into
function(x,y,z) return x+(x-2)*g(x,y,z-2*(x+y))-y*z end

is bound in a closure referencing "g", which is not an upvalue (an input parameter) of that function. May be it can be viewed as an output parameter but then it sould be still written as:

function(x,y,z,g) return x+(x-2)*g(x,y,z-2*(x+y))-y*z end

Closures are exactly that: they are passing additional parameters not passed explicitly by the call stack, to create a complete environment (context) where a lambda can be evaluated because all input and output variables are bound (independantly of additional local varaibles that may be defined inside the function.

Le dim. 18 nov. 2018 à 20:29, Luiz Henrique de Figueiredo <> a écrit :
> There have been numerous discussions on this list for lambda
> notations. Were any of those accompanied by a patch so that one could
> try them out?

See .
Equivalent code for ltokenf should be straightforward.