J3/98-123 Date: 16 Feb 1998 To: J3 From: R. Maine Subject: Edits for B.2, public entities of private type Item B.2 on the f2k work list is to allow public entities of private type. Interpretations 91 and 161 required quite subtle reading of the standard to deduce what the restrictions against such entities actually meant. It turns out that there is no real reason not to allow such entities and there are some cases where they can be useful. It apears to be just a gratuitous restriction that achieves nothing useful. Although the need for this feature is not overwhelming, it is probably easier to allow it than to write reasonably clear text disallowing it. The text in f90/f95 does not meet the criterion of being reasonably clear. This is witnessed by the subtle reasoning in interpretation 161, the several compilers that interpreted it differently, and the continuing questions on this subject from users. The only question of any significance is whether the components of a public object of private type can be visible. These edits go for consistency with the other rules for the meaning of PRIVATE; that the private attribute hides only a name, not the inderlying object. Thus, if a type is private, you cannot use that type name outside of the module, but this does not prevent you from doing anything that does not explicitly use the type name. This is the same rule adopted for host association, where "hiding" a type name does not per se hide any variables of the type or ability to access their components. The main reason for this choice is its simplicity. There is then nothing special about a type name being private. Any other choice still leaves a vestige of interp 161 to answer. Edits (to 98-007) [39:5-7] Delete this constraint. (1st constraint after R427) [40:44-45] "the type name...are accessible" -> "the type name, and thus the structure constructor(4.4.4) of the type, is accessible" [40:50+] Add shaded note BEGIN NOTE The accessibility of a type name is independent of the accessibility of the components of the type. It is possible to have all four combinations: public name with public components, private name with private components, public name with private components, and private name with public components. END NOTE [50:16] Delete this constraint. (10th constraint after R506) [62:7-9] Delete this constraint. (3rd constraint after R523)