Call a function: Difference between revisions

m
Line 17:
=={{header|Ada}}==
 
* Ada provides two kinds of subroutines: procedures, without return values, and functions, with return values. The return values of procedures must be used by the callers. If you don't want do deal with the return value, call a procedure instead.
 
* As a rule of thumb, an Ada compiler is free to pass arguments either by value or by reference. Parameters have a mode, however: either 'in' or 'out' or 'in out'. It is prohibited to write somthing to an 'in' parameter. The next language Standard, Ada 2012, will support functions with 'out' and 'in out' mode parameters, so far, only procedures could have parameters with non-'in' modes.* There are no differences between between calling built-in vs. user defined functions (or procedures). Then, the only distinction between functions and procedures in Ada is the existence of a return value.
Anonymous user