(j3.2006) (SC22WG5.3843) 09-007/UTI 151

Reinhold Bader Reinhold.Bader
Mon Jan 12 14:19:18 UTC 2009


 Hello,

 I'm trying to understand the UTI 151 (since I was initially responsible for the
 new feature I guess I should before it is unceremoniously ripped out
 again ...). Here some comments:

(1) In fact, the term "indirect" is not explicitly defined for access to entities at all; it is
      used in the standard in the context of
     * procedure invocation,
     * object reference through a pointer
     * use reference of modules
     This may well be reason enough to either properly define it or choose a different
     wording for what the feature is intended for.
(2) However, I am not sure I understand that any ambiguities actually occur based on
      the bullet list in UTI 151. In my opinion, "all-encompassing" pretty much is what
      is intended by the rule since it refers to *use association* only. Any entities needed
      from the ancestor can be accessed by the much more liberal host association anyway.
      For example take the case of  Bullet 1: "Access via use then pointer association".
      An example that comes to mind is

       use mod_b
       use mod_p
       type (b) :: ob
       :
       p => a

       "p" a pointer in mod_p, "a" a target in mod_a, "b" an entity in mod_b
      If the above code is in a submodule of a module mod_a use-referenced by mod_b, the
      compiler should be able to verify that "a" is accessed by use association (if not private)
      and reject the code. The user then corrects
      use mod_b, only : b
      and all is fine. If I am misunderstanding the bullet list, can someone provide an example
      which demonstrates either an ambiguity or a situation which cannot be checked by the
      compiler?
 (3) Would a change along the lines of

       (*) A submodule shall not directly reference its ancestor module via a use statement.
       (**) A submodule shall not access any entity from its ancestor module via use association.

       (perhaps even formulated as constraints?) accommodate the Editor's concerns? It may
       be advisable to also extend Note 11.7 to read

       * It is possible for a submodule to indirectly reference its ancestor via a use statement,
         provided that constraint (**) is fulfilled by applying suitable access restrictions (cf. Note 11.8).
       * It is possible for submodules with different ancestor modules to reference each others?
         ancestor modules by use association.

      To avoid back-references, all stuff within the scope of this discussion should probably be
      shifted to Clause 11.2.3, just after para 2.

Regards
 Reinhold



More information about the J3 mailing list