This keyword is used in:
Nowadaysrepresentation clauses are formally calledaspect clauses in the last versions of the Reference Manual due to some technicalities, althoughrepresentation clauses is the name far more extended among Ada programmers. As a historical note, they were known asrepresentation specifications (rep specs) in pre-Ada 83 proposals.[1]
[loop name:]forvarin[reverse] [typerange]rangeloop...endloop[loop name];
Whererange can be:
low..high",type'Range (ortype'Range(n) for multidimensional array types)array'Range (orarray'Range(n) for multidimensional arrays)Keywordin may also be followed by aniterable. This generalizes iteration by including types that have one of the interfaces defined inAda.Iterator_Interfaces.This language feature has been introduced inAda 2012.
Another generalized form of looping iteration uses the keywordof in place ofin. The loop parameter is then referring to components of arrays or of iterable container types, directly.This language feature has been introduced inAda 2012.
[loop name:]forvar [:type]of[reverse]iterableloop...endloop[loop name];
The keywordsfor,use andat are used for representation clauses.
A record representation clause specifies theLayoutaspect of a record.
An enumeration representation clause specifies theCodingaspect of an enumeration type.
SeeAda Programming/Representation_clauses.
This language feature has been introduced inAda 2012.
Quantified expressions are Boolean expressions. They are eitherTrue orFalse, or propagate any exception raised during evaluation.
Universal quantification expression:
(forallvarinrange=>predicate)(forallvarofiterable=>predicate)
Both forms evaluate toTrue when all of the values inrange (ofiterable) make thepredicate yieldTrue. Evaluation ofpredicate stops when either all values of loop parametervar have been exhausted, or when evaluation for some value yieldsFalse (short circuit).
Existential quantification expression:
(forsomevarinrange=>predicate)(forsomevarofiterable=>predicate)
Both forms evaluate toTrue when some of the values inrange (ofiterable) makes thepredicate yieldTrue. Evaluation ofpredicate stops when either all values of loop parametervar have been exhausted, or when evaluation for some value yieldsTrue (short circuit).
Representation clauses are now strictly known as aspect clauses — the name was changed in the 2000 Corrigendum for Ada 95 for subtle reasons that need not concern us; Ada historians might recall that they were known as representation specifications (rep specs) prior to the ANSI standardization in 1983. These various terminologies are all in use and the reader will encounter them in the literature. (pp.212–213)
| Ada Keywords | ||||
|---|---|---|---|---|
abort | else | new | return | |
abs | elsif | not | reverse | |
abstract (Ada 95) | end | null | ||
accept | entry | select | ||
access | exception | of | separate | |
aliased (Ada 95) | exit | or | some (Ada 2012) | |
all | others | subtype | ||
and | for | out | synchronized (Ada 2005) | |
array | function | overriding (Ada 2005) | ||
at | tagged (Ada 95) | |||
generic | package | task | ||
begin | goto | parallel (Ada 2022) | terminate | |
body | pragma | then | ||
if | private | type | ||
case | in | procedure | ||
constant | interface (Ada 2005) | protected (Ada 95) | until (Ada 95) | |
is | use | |||
declare | raise | |||
delay | limited | range | when | |
delta | loop | record | while | |
digits | rem | with | ||
do | mod | renames | ||
requeue (Ada 95) | xor | |||