Department of Computer Science



next up previous
Next: Objects, classes and scope Up: Names, scope and encapsulation Previous: Local variables, blocks and


Scope and dependency in functional languages


Functional programming languages do have all the apparatus of modules, functions and nested scope, which are needed to control textual dependence. But they don't have a problem of dynamic dependence, because the programs are ``static'', no values ever change. This property is known as referential transparency, it means that any expression only ever depends on the expression and its parameters. All references to surrounding values (``globals'') are always the same because such values are constant (there are no updateable stored variables).

This greatly simplifies debugging and understanding because no ``dry-runs'' are needed to determine what values global names will have. Also because there is no dynamic dependence possible it means compilers can compile sub-expressions to execute concurrently without the user needing to restructure the program or explicitly write parallel tasks. This gives the potential of easily exploiting highly parallel architectures, something that is hard to do with procedural languages which must be explicitly programmed for concurrent execution.


next up previous
Next: Objects, classes and scope Up: Names, scope and encapsulation Previous: Local variables, blocks and


Page generated: 2002-11-04 by Bob Dickerson

© University of Hertfordshire Higher Education Corporation (1998)

Disclaimer