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
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
{
AI12-0429-1}
Example of the declaration of a null procedure:
{
AI95-00433-01}
{
AI12-0440-1}
procedure Simplify(Expr :
in out Expression)
is null; --
see 3.9
--
By default, Simplify does nothing, but it can be overridden in extensions of Expression
Extensions to Ada 95
Extensions to Ada 2005
Wording Changes from Ada 2012
{
AI12-0408-1}
Clarified the term “null procedure” so it matches the meaning
expected in
6.1.
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe