Namespace search order

Search locations can come from four possible sources: Compiler options, the project file's namespaces clause, the project default namespace, and finally, the current unit's namespace.

A project file (program, library or package) may optionally specify a list of namespaces to be searched when resolving generic unit names. The namespaces clause must appear in the project file, immediately after the program, library, or package declaration and before any other clause or block type. The namespaces clause is a list of namespace identifiers, separated by commas. A semicolon must terminate the list of namespaces.

The compiler resolves identifier names in the following order:

  1. The current unit namespace (if any)
  2. The project default namespace (if any)
  3. Namespaces specified by the project's namespaces clause (searched in reverse order of declaration in the list).
  4. Namespaces specified by compiler options.

Was this article helpful?

0 0
Project Management Made Easy

Project Management Made Easy

What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.

Get My Free Ebook

Post a comment