Try to implement a Go like defer statement
Opened this issue · 0 comments
dibyendumajumdar commented
Recently Roberto has been working on toclose
variables in Lua 5.4. Lots of debate on the list around this.
I would like to try out something similar but slightly different.
Main idea is to use the luaF_close() way of handling upvalue closure but actually have a separate list of deferred functions. Provide an API to add a function to the list of deferred functions.
Might need a new opcode because we need to reserve stack slots at compile time.