1Namespaces: Model and Operations
Most programming languages currently in use offer tools to facilitate the construction and maintenance of large software. Two approaches coexist, that of languages with modules and that of object-oriented languages; approaches that are different or even historically opposed but which in fact share many characteristics. This is why this chapter elaborates on a unique model of these two approaches by introducing a structure, referred to here as kit, as well as operations on these kits. We have chosen to introduce our own vocabulary for this study as programming languages sometimes use the same words to designate tools whose meanings differ significantly. The notion of a kit will be progressively enriched during its presentation. It will serve as a common framework to reflect the division of software into sub-systems, to explain management of names, export and import mechanisms, different possibilities of restricting access to elements of these kits, and extension mechanisms. Modules, classes and objects will be presented using this framework in the following chapters.
This chapter introduces a large number of notions which may seem difficult. It can be read in two passes. The first pass will give the reader an overview of the contents and may be followed by reading at least one of Chapters 2 or 3. This can be seen as a real exercise if, at the same time, the reader illustrates the notions with a few examples in the language they use. The second ...
Get Concepts and Semantics of Programming Languages 2 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.