News for hackers. Stuff that matters.
Re:NASA has a list of 10 rules for software development by ww520 on Saturday February 15, 2025 @08:12PM (#43064315)
For most languages, the inner function body when first defined is parsed/compiled once, with the unbound free variables collected in a list. At the next calling of the function definition, the compiled function body is reused and only the free variables are bounded to the variables in the outer environment (closure). It's quite efficient. Depending on the implementation, it could be literally just setting a pointer to point to the outer environment.

There are no comments on this comment yet.