Purely local nested functions (that require no references to outer local variables)
Local nested functions that do refer to local variables in an outer function
Nested function that get exported to more global visibility - these need to form closures to ensure that local variables maintain an appropriate lifetime.
There are several interesting cases: