Kinds of Expressions

Among basic expressions are literals, for example, decimal (real), enumeration, string, and access value literals:

2.5e+3
False
"и"
null

Involving many of those one can write aggregates (a primary),

(X => 0.0,
 Y => 1.0,
 Z => 0.0)

Arbitrarily complex sub-components are possible, too, creating an aggregate from component expressions,

(Height => 1.89 * Meter,  
 Age    => Guess (Picture => Images.Load (Suspects, "P2012-Aug.PNG"),
 Tiles   => Grid'(1 .. 3 => Scan, 4 => Skip)),
 Name   => new Nickname'("Herbert"))

Age is associated with the value of a nested function call. The actual parameter for Tiles has type name Grid qualify the array aggregate following it; the component Name is associated with an allocator.

The well known mathematical’ expressions have closely corresponding simple expressions in Ada syntax, for example 2.0πr, or the relation

Area = π*r**2

Other expressions test for membership in a range, or in a type:

X in 1 .. 10 | 12
Shape in Polygon'Class

Date
February 28, 2024