Function (computer programming): Difference between revisions

Content deleted Content added
Nested scope: scope of nested procedure
Simplify; stay on topic; reference other page
Line 243:
=== Nested scope ===
 
{{main|Nested function}}
Some languages such as [[Pascal (programming language)|Pascal]], PL/I, and [[Ada (programming language)|Ada]] support nested [[scope (programming)|scope]] for a callable, a.k.a. [[nested function]], so that an inner callable is only callable
 
# From the directly enclosing scope
Some languages such as [[Pascal (programming language)|Pascal]], PL/I, and [[Ada (programming language)|Ada]] support nested [[scope (programming)|scope]] for a callabledeclaring, a.k.a. [[nestednesting, a function]], soinside a function body {{endash}} such that anthe innername callableof the inner is only callablevisible within the body of the outer.
# From within the inner callable
# From a callable that has been passed the inner callable as an argument; in this case the parameter retains access to local variables of the enclosing scope and serves as a [[Closure (computer programming)|Closure]].
The inner callable may have access to the local variables of the outer.
 
=== Reentrancy ===