Part 2 - Algorithmic Aspects
Published online by Cambridge University Press: 05 July 2014
Summary
This second part covers the small-scale algorithmic features of the language in detail. These correspond to the areas covered by simple languages such as Pascal and C although Ada has much richer facilities in these areas.
Chapter 5 deals with the lexical detail which needs to be described but can perhaps be skimmed on a first reading and just referred to when required. It also briefly introduces aspect specifications which are an important new feature of Ada 2012.
Chapter 6 is where the story really begins and covers the type model and illustrates that model by introducing most of the scalar types. Chapter 7 then discusses the control structures which are very straightforward. Chapter 8 covers arrays in full but only the simplest forms of records; it is also convenient to introduce characters and strings in this chapter since strings in Ada are treated as arrays of characters. Chapter 8 is quite long compared with a corresponding discussion on Pascal or C largely because of the named notation for array aggregates which is an important feature for writing readable programs.
Chapter 9 discusses the more elaborate forms of expressions introduced in Ada 2012, namely if expressions, case expressions and quantified expressions.
Subprograms are discussed in Chapter 10 and at this point we can write serious lumps of program. Again the named notation enriches the discussion and includes the mechanism for default parameters.
Chapter 11 contains a discussion on access types which correspond to pointers in Pascal and C.
- Type
- Chapter
- Information
- Programming in Ada 2012 , pp. 63 - 64Publisher: Cambridge University PressPrint publication year: 2014