3 ms·
In practice the inner function (the body of a lexical closure) is only compiled once. When a "new function is made" at runtime, a data structure for the new lex
by dreamcompiler 8y ago
In practice the inner function (the body of a lexical closure) is only compiled once. When a "new function is made" at runtime, a data structure for the new lexical environment is created together with a pointer to the already-compiled closure body. So the executable portion (the actual instructions of the closure) are only allocated once.