Jump to content

Nested function: Difference between revisions

Task description: improve wording for inner function responsibility.
(Added PicoLisp)
(Task description: improve wording for inner function responsibility.)
Line 13:
The outer function (called <tt>MakeList</tt> or equivalent) is responsible for creating the list as a whole and is given the separator <tt>". "</tt> as argument. It also defines a counter variable to keep track of the item number. This demonstrates how the inner function can influence the variables in the outer function.
 
The inner function (called <tt>MakeItem</tt> or equivalent) is reponsible for creating one of thea list itemsitem. It accesses the separator from the outer function and modifies the counter.
 
'''References:'''
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.