X3J3/96-027 (Page 1 of 2) To: X3J3 From: David Epstein Subject: What is a CoCo module? Date: January 19, 1996 The Conditional Compilation (CoCo) development body has recently been discussing details of CoCo modules. At the last X3J3 meeting in San Diego, the CoCo discussion led me to believe that the idea of CoCo modules was not completely understood or defined. There was similar confusion about CoCo modules during the CoCo email discussions about the ?module, ?endmodule and ?use directives. Below is a slightly modified copy of a CoCo email note that appears to clarify what a CoCo module is and how it is used. Becoming familiar with CoCo modules will aid in any conditional compilation discussions at the next X3J3 in Las Vegas. I am on the schedule for Monday, and CoCo modules may be most of the presentation. See you in a few weeks, David ----- What is a CoCo module? (A copy of a CoCo email note) ---- So far, a CoCo module is similar to a CCF module. The somewhat complete definition of a CCF module was supplied in an X3J3 paper distributed thru email, 1995 July for the Aug. X3J3 Breckenridge meeting. Since many have not seen that definition, it goes something like this ... (this is not the standardese version) A CoCo-module contains CoCo-integer and CoCo-logical statements (probably better to call them "directives") For example: ? module my_systems ? integer, parameter :: DOS = 1 ? integer, parameter :: UNIX = 2 ? integer :: system = DOS ? endmodule my_systems Given the above CoCo-module, somebody could apply the CoCo-use directive as follows: ? use my_systems Since there are no ?contains or ?procedures, it follows that only ?integer and ?logical statements shall be in a ?module. X3J3/96-027 (Page 2 of 2) NOTE: Recall that only lines that start with a '?' (and now a 'INCLUDE "' or a "INCLUDE '") are *seen* by the CoCo processor; all other lines have nothing to do with CoCo. The following are examples of non-CoCo lines: print *, 'Entering Function FOO' program main main (argc, argv) I went for a walk today on the beach and saw a dog. car(cdr(car(cdr(list module non_coco_mod ! has nothing to do with any CoCo directives NOTE: The availability of CoCo-modules facilitates the coding task for large teams that would otherwise have to either: (a) copy the declarations for 'DOS', 'UNIX' and 'system' into all source text that required conditional compilation on 'system' (b) put the declarations for 'DOS', 'UNIX' and 'system' into a system dependent thingo (probably a *file*) and INCLUDE it