9/30/2005
Modern Programming Languages Chapter 12
41
Nesting Functions
•What we just saw is adequate for many languages, including C
•But not for languages that allow:
•Function definitions can be nested inside other function definitions
•Inner functions can refer to local variables of the outer functions (under the usual block scoping rule)
•Like ML, Ada, Pascal, etc.