3 ms·
q's functions don't capture the environment, so that's the same as: a:42 {[a]a+1}[5] and as in javascript: a=42; f=function(a){return a+1} a
by geocar 5y ago
q's functions don't capture the environment, so that's the same as:
a:42
{[a]a+1}[5]
and as in javascript:
a=42;
f=function(a){return a+1}
and when i say they don't capture the environment, i mean this:
f:{[g] {g+x}}
doesn't do anything except generate errors (° there are benefits to this approach!) because the inner function (that we are returning) sees the "global" g and not the one lexically scoped in the function (a better way to say it: no closures).