Yes, your terminology is a bit unclear. If I'm not mistaken, type tA is
available everywhere in module B by virtue of B use-ing A and by virtue
of tA being public in module B. But if you have a module C that use-s B,
and does not use A, you have no acess to type tA, even if type tB is
declared public in module B as you state it is. You cannot, for example,
declare a variable of type tA in module C. To do so you need to take one
of two actions: Use module A in module C; declare type tA public in
module B.
Norm Clerman
Aleksandar Donev wrote:
>Hello,
>
>A question about modules:
>
>Module A defines public type tA
>
>Module B has a global PRIVATE, USEs A, and defines a public type tB with a
>component of type tA. It *does not* export tA as PUBLIC.
>
>Does this automatically (implicitly) make tA PUBLIC in tB? I may be using
>wrong terminology, but the point is that the type tA is needed in order to
>deal with objects of type tB (this I assume is the reason why public types
>cannot have components of private type).
>
>Thanks,
>Aleksandar
>--
>NOTE change of primary e-mail to [log in to unmask]
>__________________________________
>Aleksandar Donev
>Complex Materials Theory Group (http://cherrypit.princeton.edu/)
>Princeton Materials Institute &
>Program in Applied and Computational Mathematics
>@ Princeton University
>Address:
> 419 Bowen Hall, 70 Prospect Avenue
> Princeton University
> Princeton, NJ 08540-5211
>E-mail: [log in to unmask]
>WWW: http://atom.princeton.edu/donev
>Phone: (609) 258-2775
>Fax: (609) 258-1177
>__________________________________
>
>
>
|