Arranging Code in Compilation Units
Classical Occam allows you to define processes as top-level, first-class statements. According to KRoC, a process must be a part of a compilation unit—a procedure or a function. An Occam file may contain data type and constant definitions and any number of compilation units, including no units at all.
Procedures
You’ve already seen procedures in this chapter, though they weren’t the focus of discussion but mere wrappers around the code of interest. Let’s look at them closely.
A procedure, also known as a named process in the classical Occam, has a name, optional parameters, and optional local variables. Syntactically, a procedure starts with the keyword PROC and ends with a colon : (not a semicolon ; !). ...
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