In a progamming language with NestedScopes, source code has a nested structure such that variable definitions can be introduced at any level of nesting.
NestedScopes can be combined with either LexicalScoping or DynamicScoping; see the DynamicScoping entry for an explanation of the differences.
Languages that support nested scopes include SchemeLanguage, CommonLisp, EeLanguage, and JavaLanguage (using InnerClasses).
In CeeLanguage, there are four kinds of scope:
While it is not possible in AnsiCee to nest the definition of functions, it is possible to nest scopes where variables are defined arbitrarily deeply, like this:
void wibble(){ { int a; { int b; { //etc... } } } }As an extension, GnuCee supports nested functions, and therefore full NestedScopes.
See also GlobalVariablesConsideredHarmful, LexicalScoping, DynamicScoping.