6.8 Expression Functions
Syntax
Name Resolution Rules
Legality Rules
If the result subtype has one or more unconstrained
access discriminants, the accessibility level of the anonymous access
type of each access discriminant, as determined by the
expression
of the expression function, shall not be statically deeper than that
of the master that elaborated the
expression_function_declaration.
Static Semantics
Dynamic Semantics
The execution of an expression function is invoked
by a subprogram call. For the execution of a subprogram call on an expression
function, the execution of the
subprogram_body
executes an implicit function body containing only a
simple_return_statement
whose
expression
is that of the expression function.
The elaboration of an
expression_function_declaration
has no other effect than to establish that the expression function can
be called without failing the Elaboration_Check.
Examples
function Is_Origin (P :
in Point)
return Boolean
is --
see 3.9
(P.X = 0.0
and P.Y = 0.0);
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe