Autonomous functions
We have chosen the term autonomous function for a function
that accomplishes its work using only:
- values of arguments and local variables computed from these
arguments,
- globally defined constants, and
- globally defined autonomous functions that are assumed to be
nearly constant.
Autonomous functions are much easier to test and debug than other
functions, since they yield the same result every time they are
executed. They are not influenced by changes in the global
environment such as values of global variables).
Notice that the definition is recursive, so that autonomous functions
can be built as long as only other autonomous functions are used in
their implementation.
This fact greatly simplifies bottom-up programming, in which
more and more complex functions are created out of simpler,
lower-level functions. Keeping these functions autonomous makes it
possible to test and debug very complicated functions in a very
efficient way.