6.7 Null Procedures
Syntax
Legality Rules
Static Semantics
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
{
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.
Ramification: Thus,
a null procedure is equivalent to the body
begin
null;
end;
with the exception that
a null procedure can be used in place of a procedure specification.
Examples
{
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
Extensions to Ada 2005
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe