Frank Heckenbach wrote:
Prof A Olowofoyeku (The African Chief) wrote:
I have a problem. I don't want to export everything. I only want to export things in the current interface section (and there are hundreds of them, and a few of them are routines from the GPC unit/module).
I have tried;
module sysutils interface; export sysutils = all; import GPC; system;
blah, blah; end. module sysutils implementation;
blah blah; end.
I am getting errors (such as "unknown identifier `TString'", "unknown identifier `UnixTimeType'", etc).
Any ideas?
Imports in an interface module are not visible in the corresponding implementation module. But they are visible in the implementation when using a "simple" module like this:
module sysutils; export sysutils = all; import GPC; System;
end;
var a: TString;
end.
At least that's GPC's current behaviour. Perhaps the EP experts can confirm whether this is correct?
Unless I'm missing something, I think paragraph 6.2.2.12, "Each defining-point that has as a region a module-heading shall also have as a region the module-block that is associated with that module-heading.", requires imports into a "separated" module-heading to be treated just the same as your "simple" module case.
Since the paragraph 6.11.3 language, "Each defining-point of an imported identifier occurring within an import-specification shall be for the region that is the import-specification, and, if an access-qualifier does not occur in the import- specification, also for the region that is the module-heading, module-block, or block closest-containing the import-specification.", creates defining-points for imported identifiers in the module-heading region including the "separated" module-heading case, 6.2.2.12 will in turn require those defining-points to exist in the "separated" module-block region.
If, as indicated, GPC doesn't make heading imports "visible" in the corresponding implementation block, then GPC isn't in full conformance with ISO 10206 requirements.
As Prof Olowofoyeku's experience indicates, if identifiers visible in the separate module-heading aren't automatically visible in the separate module-block, creating the implementation for an interface becomes more troublesome. I think the most troublesome aspect is not having the imported type-identifiers used in defining the interface automatically visible when defining the corresponding implementation.
Gale Paeper gpaeper@empirenet.com