Searching Namespaces A unit must declare the other units on which it depends. As with the Win32 platform, the compiler must search these
units for identifiers. For units in explicit namespaces the search scope is already known, but for generic units, the
compiler must establish a namespace search scope.
Consider the following unit and uses declarations:
unit MyCompany.Programs.Units.MyUnit1;
uses MyCompany.Libs.Unit2, Unit3, Unit4;
These declarations establish
MyUnit1
as a member of the
MyCompany.Programs.Units
namespace.
MyUnit1
depends on three other units:
MyCompany.Libs.Unit2
, and the generic units,
Unit3
, and
Unit4
. The
compiler can resolve identifier names in
Unit2
, since the uses clause specified the fully qualified unit name. To
resolve identifier names in
Unit3
and
Unit4
, the compiler must establish a namespace search order.