Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Latest commit

 

History

History
9 lines (5 loc) · 791 Bytes

nested_functions.md

File metadata and controls

9 lines (5 loc) · 791 Bytes

Nested functions

In computer programming, a nested function (or nested procedure or subroutine) is a function which is defined within another function, the enclosing function. Due to simple recursive scope rules, a nested function is itself invisible outside of its immediately enclosing function, but can see (access) all local objects (data, functions, types, etc.) of its immediately enclosing function as well as of any function(s) which, in turn, encloses that function. The nesting is theoretically possible to unlimited depth, although only a few levels are normally used in practical programs.1


[1] Nested function, Wikipedia. (2020). https://en.wikipedia.org/wiki/Nested_function (accessed September 3, 2020).