Can anyone explain me the difference between the Ada "procedure" and "function"?
The function of the adenosine deaminase enzyme is to eliminate a molecule called deoxyadenosine, which is generated when DNA is broken down. Adenosine deaminase converts deoxyadenosine, which is toxic to lymphocytes, to another molecule called deoxyinosine, which is not harmful.
The ADA does not specify procedural safeguards related to special education; it does detail the administrative requirements complaint procedures, and consequences for noncompliance related to both services and employment.
A procedure performs a task, whereas a function produces information. Functions differ from procedures in that functions return values, unlike procedures which do not. However, parameters can be passed to both procedures and functions. In a program for drawing shapes, the program could ask the user what shape to draw.
=> has multiple purposes: Parameter passing: Which formal parameter is passed which argument (if it isn't done by order). Record and array aggregates: Which field gets which value. Aspects: Separating aspect names from the expressions they are assigned.
Ada language is not very much different comparing to other imperative C-like languages. The syntax though may look very strange and overwhelmed with different statements, but this is mainly because of a very rich static typing system and features directly provided by language (like tasks for example), that other languages provide as side libraries.
Unlike most of C-like languages, Ada distinguishes procedural and functional routines. In this sense function is very much as mathematical function that takes arguments (or none) and returns a value, and thus is used in expressions. Procedures do not return any values and cannot be used in expressions. Pascal language keeps the same distinction between functions and procedures. C-like languages chose to have just functions that can be used outside expressions (returned value is ignored in this case) or return a void value to act like a procedure.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With