The purpose of a name space is to keep track of what value a name represents and, in the case of a variable name, what type of value it may represent.
When a name is not found in the current name space, the name space associated with the program element which contains the program element which contains the instruction causing the search is searched, and so on. In other words, name spaces are not searched in the order in which they were created (dynamic scoping), but in the order in which their associated program elements are syntactically nested (static scoping).
For example, the following program prints 1 and 3:
i : Integer := 1 p proc p i : Integer := 2 q proc q put i i : Integer := 3 put iNote that a name may be added to the current name space, even after the name has already been found in an enclosing name space. In other words, the introduction of a name into the current name space hides the name in enclosing name spaces only from the point of definition up to the end of the associated program element.