1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
Add: is Math:Add Math:Add imports :Utility (= Math:Utility)
Math: is Math Math imports :Utility (= Math:Utility)
:Add (= Math:Add)
Utility: is Math:Utility imports nothing
Compilation: Math:Utility first. Remove Math:Utility, so compile Math:Add;
remove Math:Add, so compile Math
----------------------------------------------------------------------------
Math uses partitions Add and Utility to add and multiply values Add uses
Utility
When constructing a module component use makeclass, then move classname.h to
module.cc and create a gcm.cache link to the parent (also handled by
modmapper).
Replace the include guard by 'export module Modulename', where Modulename can
also be a partition name.
In the .ih file replace '#include "header.h"' by 'import Modulename;' and
likewise with other #include directives. Source files of partitions other than
the module.cc files must (?) declare the module and then the
import. E.g.,
module Math;
import :Add;
These required elements can be defined in the partition's frame file
For the main module source files use 'import Modulename;' in the .ih file.
partitions must be imported using 'export import'
If the compiler states that a compnent (e.g. class) hasn't been declared then
maybe the module didn't export the component
Except for modules importing partitions (using 'export import :Partitionname;'
partitions cannot be imported elsewhere. You can't do
'import Modname:Partname;' so partitions are only accessible within the
module's context.
When importing stuff in module.cc files use 'export import' since those
imported things must be available when importing the module.
NB: partitions use a single :, not ::
As with class definitions using class.h files do not depend on using classes
including everything that's needed by the class. See
math/module.cc. Module.cc files should completely define their own
interfaces.
-----------------------------------
When implementing partitions and changing the organization of a partition,
recompile the interfaces and then recompile the members.
|