|
|
|
|
|
by JonChesterfield
317 days ago
|
|
The idea is to move variables from the body of the function to the argument list and rewrite the call sites to match. That decreases the size of the closure (and increases the size of the code, and of however you're passing arguments). Do it repeatedly though and you end up with no free variables, i.e. no closure to allocate. Hence the name, the lambda (closure) has been lifted (through the call tree) to the top level, where it is now a function (and not a lambda, if following the usual conflating of anonymous function with allocated closure). Doesn't work in the general case because you can't find all the call sites. |
|