Previous Contents Next


Every language comes with collections of programs that are reusable by the programmer, called libraries. The quality and diversity of these programs are often some of the criteria one uses to assess the ease of use of a language. You could separate libraries into two categories: those that offer types and functions that are often useful but could be written in the language, and those that offer functionality that cannot be defined in the language. The first group saves the programmer the effort of redefining utilities such as stacks, lists, etc. The second group extends the possible uses of the language by incorporating new functionality into it.

The Objective CAML language distribution comes with many precompiled libraries. For the curious reader, the uncompiled version of these libraries comes packaged with the source code distribution for the language.

In Objective CAML, all the libraries are organized into modules that are also compilation units. Each one contains declarations of globals and types, exceptions and values that can be used in programs. In this chapter we are not interested in how to create new modules; we just want to use the existing ones. Chapter 14 will revisit the concepts of the module and the compilation unit while describing the module language of Objective CAML, including parameterized modules. Regarding the creation of libraries that incorporate code that is not written in Objective CAML, chapter 12 will describe how to integrate Objective CAML programs with code written in C.

The Objective CAML distribution contains a preloaded library (the Pervasives module), a collection of basic modules called the standard library, and many other libraries adding functionality to the language. Some of the libraries are briefly shown in this chapter while others are described in later chapters.

Previous Contents Next