[Prev]
[Next]
[Limbo Basics] [Limbo Programming] [Language Definition]
Scope of Data
The scope of data depends on where it is declared:
-
If data is declared in the module declaration, it is available to all functions within the module. This is referred to as module data and is global in the context of the module. Module data is initialized to 0 (zero) or null. If it is declared in a module interface file, it is public, available to other programs that load the module.
-
If data is declared outside of functions and not in the module declaration, it is global in the module, but is private.
-
If data is declared or initialized within a function, it is only available within that function. Function data can be passed between functions. It is not available to other programs, unless explicitly passed.
-
If data is declared or initialized within a statement block, it is only available within that block.
Figure 2-4 illustrates the dependency of the point of declaration and the scope of data.
Figure 2-4 Scope of Data
[Prev]
[Next]
[Limbo Basics] [Limbo Programming] [Language Definition]
Copyright © 1998, Lucent Technologies, Inc. All rights
reserved.