5. Embedded QUEL for Ada : Ada Variables and Data Types : Compilation Units and the Scope of Variables : The Function
 
Share this page                  
The Function
The syntax for an EQUEL/Ada function is:
function func_name [(formal_parameters)return result_type is
              
[declarations]
begin
              
statements
end [func_name];
Syntax Notes:
1. Func_names on the function and end statements are not processed and are not compared for equivalence, as required by Ada.
2. EQUEL need not know the result_type, because EQUEL does not allow the use of functions in place of variables in executable statements.
3. Formal parameters and variables declared in a function are visible to the function and to any nested blocks.
4. Formal parameters and their syntax are described in the section on variable declarations.