Next topic | Ada Home Page | Index

Separate compilation

Motivation

Program development is made much less complex if you are able to do two things:

The first is the reason we focus on procedures as the blocks from which a program is constructed.

The second lets us develop and test a program a bit at a time. This makes testing and debugging simpler than if you test the whole program all at once.

For it to be possible to develop a program a bit at a time, there needs to be some help from the language. You need to be able to break programs into several files, each of which is compiled separately.

Ada library

To understand the mechanisms for separate compilation, we need to know how the compiler makes use of the Ada library

A program can be compiled in pieces

Units for separate compilation

Ada provides two mechanisms for separate compilation:

Usually a library unit is a package.

When to use each sort of unit:

A subunits is written to be part of a single specific program. A library unit may be used in many programs.


Next topic | Ada Home Page | Index
c-lokan@adfa.oz.au / 17 Feb 1996