4 ms·
Any function is a closure. Top-level function declarations can capture static variables and type members. Nested functions can capture static variables, type me
by garganzol 3y ago
Any function is a closure. Top-level function declarations can capture static variables and type members. Nested functions can capture static variables, type members, and local variables of a declaring function. Difference is negligible.
- brundolf 3y agoConceptually, as a high-level user of a typical language. But there can be nuanced differences in the implementation and/or the semantics, depending on the language. I don't know if that's true here, but it's certainly plausible.