"Descriptional Composition of Compiler Components":
A.2.8 Function Declarations
Procedures, types, or variables declared outside the scope of the function cannot
be called, modified, or defined respectively inside the body of the function
Example:
procedure identity_procedure(arg : Integer) : Integer begin
-- Good. we can can a function from procedure
result := identity_function(arg);
end;
function identity_function(arg: Integer) : Integer begin
-- Bad. we should not be able to call a procedure from function
result := identity_procedure(arg);
end;
"Descriptional Composition of Compiler Components":
Example: