3 ms·
Only most of the languages you use every day[1]. Pascal inherited nested functions from ALGOL so everything in that family does it. Lisp dialects with lexical s
by whoopdedo 3y ago
Only most of the languages you use every day[1]. Pascal inherited nested functions from ALGOL so everything in that family does it. Lisp dialects with lexical scope will have it. You can even get it in C if you use GCC[2]. (And if you don't mind turning off the NX stack.)
[1] https://en.wikipedia.org/wiki/Nested_function#Languages https://en.wikipedia.org/wiki/Nested_function#Languages
[2] https://www.gnu.org/software/c-intro-and-ref/manual/html_node/Nested-Functions.html https://www.gnu.org/software/c-intro-and-ref/manual/html_nod...
- HarHarVeryFunny 3y agoWell, I'm not actually using ALGOL or Lisp every day, but ok ... :) There's a variety of implementations there though - some seem to be talking about closures, and at least one (Rust) doesn't appear to support parent variable access.