A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.wikibooks.org/wiki/Ada_Programming/Keywords/for below:

Ada Programming/Keywords/for - Wikibooks, open books for an open world

From Wikibooks, open books for an open world

Ada. Time-tested, safe and secure.


This keyword is used in:

Nowadays representation clauses are formally called aspect clauses in the last versions of the Reference Manual due to some technicalities, although representation clauses is the name far more extended among Ada programmers. As a historical note, they were known as representation specifications (rep specs) in pre-Ada 83 proposals.[1]

[loop name :] for var in [ reverse ] [type range] range loop
   ...
end loop [loop name];

Where range can be:

Keyword in may also be followed by an iterable. This generalizes iteration by including types that have one of the interfaces defined in Ada.Iterator_Interfaces. This language feature has been introduced in Ada 2012.

Another generalized form of looping iteration uses the keyword of in place of in. The loop parameter is then referring to components of arrays or of iterable container types, directly. This language feature has been introduced in Ada 2012.

[loop name :] for var [: type] of [ reverse ] iterable loop
   ...
end loop [loop name];

The keywords for, use and at are used for representation clauses.

A record representation clause specifies the Layout aspect of a record.

An enumeration representation clause specifies the Coding aspect of an enumeration type.

See Ada Programming/Representation_clauses.

This language feature has been introduced in Ada 2012.

Quantified expressions are Boolean expressions. They are either True or False, or propagate any exception raised during evaluation.

Universal quantification expression:

(for all var in range => predicate)
(for all var of iterable => predicate)

Both forms evaluate to True when all of the values in range (of iterable) make the predicate yield True. Evaluation of predicate stops when either all values of loop parameter var have been exhausted, or when evaluation for some value yields False (short circuit).

Existential quantification expression:

(for some var in range => predicate)
(for some var of iterable => predicate)

Both forms evaluate to True when some of the values in range (of iterable) makes the predicate yield True. Evaluation of predicate stops when either all values of loop parameter var have been exhausted, or when evaluation for some value yields True (short circuit).

  1. John Barnes (2003-03-25). High-Integrity Software — The SPARK Approach to Safety and Security. Addison-Wesley. ISBN 0-321-13616-0. Retrieved 2008-06-06. 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)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.3