| Trying to keep this thread going... there may be overlaps with
C++ namespace representations.
There are two parts to F90 module support: definition and usage.
Definition is roughly a named block:
MODULE <modname>
...
END [MODULE [<modname>]]
Within the module there can be USE'age of other modules, types
definitions, data definitions and procedures definitions. There is
provision for PUBLIC and PRIVATE. It looks a little like a
class/struct; it looks a little like a namespace. Modules don't have
parents, as Java packages do and namespaces might; this might make
modules a special case (the never-a-parent special case). Modules can
use other modules (see next), but this is more usage than inheritance.
Usage is a reference within a procedure or a module to [another]
module; the F90 'USE' statement.
-- In its simplest form,
USE <modname>
causes all the PUBLIC module members to be visible to the user. A
little like inheritance, a little like namespaces.
-- There are two variants, which are orthogonal: renaming, and ONLY.
-- Renaming allows the client to use a different name than that
defined in the module:
USE <modname>, A => B
means that when I say 'A' I mean 'B within the module', and all
other members of the module are accessible via their module-given
names. If namespaces have renaming-import, it's like that.
-- ONLY means only to import the specified symbols:
USE <modname>, ONLY : C, D
means only use members C and D from the module. If namespaces
have restricted-import, it's like that.
-- They can be combined:
USE <modname>, ONLY : A => B, C, D
means only use B, C and D, but I'm going to say A when I want to
reference B.
-- At the usage level, just the names are relevent; it doesn't matter
if they are type, data or procedure names. I suspect this is like
namespaces.
[Posted by WWW Notes gateway]
|