Introducing Procedures
As a procedural language, Simula incorporates procedures and function procedures. The distinction lies in their return values. Similar to void functions in C and C++, regular procedures don’t yield a return value but instead operate through side effects, such as altering global variables and parameters or conducting input/output. On the other hand, function procedures have a specific data type and must return a value of this type. We’ll refer to both types as “procedures” for simplicity, with differentiation made only when required.
Unless declared with the EXTERNAL keyword, procedures must be defined prior to their initial usage within the same BEGIN/END block. A procedure’s definition includes the return type (for ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access