6.7 Null Procedures
1/2
Syntax
2/3
Legality Rules
2.1/3
Static Semantics
3/3
3.a/2
Reason: There are no null functions because
the return value has to be constructed somehow; a function that always
raises Program_Error doesn't seem very useful or worth the complication.
Dynamic Semantics
4/2
{
AI95-00348-01}
The execution of a null procedure is invoked by a subprogram call. For
the execution of a subprogram call on a null procedure, the execution
of the
subprogram_body
has no effect.
4.a/2
Ramification: Thus, a null procedure
is equivalent to the body
4.b/2
begin
null;
end;
4.c/2
with the exception that a null procedure can
be used in place of a procedure specification.
5/3
Examples
6/2
{
AI95-00433-01}
procedure Simplify(Expr :
in out Expression)
is null; --
see 3.9
--
By default, Simplify does nothing, but it may be overridden in extensions of Expression
Extensions to Ada 95
6.a/2
Extensions to Ada 2005
6.b/3
6.c/3
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe