On Sun, Apr 20, 2003 at 01:11:37PM +0200, Frank Heckenbach wrote:
Gale Paeper wrote:
Frank Heckenbach wrote:
One of the listed bugs of GPC was "modules without implementation".
Where is the bug listed? It isn't listed under "Known bugs in GPC" at < http://www.gnu-pascal.de/gpc/Known-Bugs.html%3E.
However, if I understand EP correctly, this actually doesn't concern `interface' modules (as in pmodtest.pas without the `implementation' part):
If I understand the comment in pmodtest.pas correctly, EP always requires one and exactly one implementation module to be associated with an interface module. Even if the module-block is empty (except for the required 'end'), there still must exist an implementation module to associate with an interface module. This is what the "shall have exactly one" language in ISO 10206 requires.
What seems to be missing is this variant (no module-block at all), and I'll add it in the next release (that's easy to do):
module fjf843m;
export fjf843m = all;
const OK = 'OK';
end.
I really don't see any need for this variant. It isn't in any way conformant to ISO 10206 requirements and the only "value" of it is to save typing an 'end;'. There are already enough problems with the gaggle of non-compatible, non-standard ISO 7185 based dialect variants so there is no need to create additional problems with non-standard ISO 10206 variants which serves no purpose other than to save typing *four* characters.
I meant that this form *is* according to EP:
: programÂcomponent = mainÂprogramÂdeclaration `.' : | moduleÂdeclaration `.' . : moduleÂdeclaration = moduleÂheading [ `;' moduleÂblock ] : | moduleÂidentification `;' moduleÂblock . : moduleÂheading = `module' identifier [ interfaceÂdirective ] : [ `(' moduleÂparameterÂlist `)' ] `;' : interfaceÂspecificationÂpart : importÂpart : { constantÂdefinitionÂpart : | typeÂdefinitionÂpart : | variableÂdeclarationÂpart : | procedureÂandÂfunctionÂheadingÂpart } : `end' .
Note the optional module-block in the first form of module-declaration. So IIUIC, there are 3 kinds of "module components": module headings with `interface' (aka interface modules), module headings without `interface' and module identifications (aka implementation modules).
Maybe I'm missing the point here, but: the second kind of module "components" _must_ include a module block (this doesn't follow from the BNF rules, but from the text of 6.11.1). Hence this is not valid (in EP):
module fjf843m;
export fjf843m = all;
const OK = 'OK';
end.
Emil