One of the listed bugs of GPC was "modules without implementation". However, if I understand EP correctly, this actually doesn't concern `interface' modules (as in pmodtest.pas without the `implementation' part):
: Each identifier having a definingÂpoint as a moduleÂidentifier in a : moduleÂheading of a module declaration containing the interfaceÂdirective : interface shall have exactly one of its applied occurrences in a : moduleÂidentification of a moduleÂdeclaration containing the : implementationÂdirective implementation.
In contrast, the following works in GPC (with an almost empty module-block):
module fjf843m;
export fjf843m = all;
const OK = 'OK';
end;
end.
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.
However, AFAICS, EP doesn't require to support `interface' modules without implementation. That's good because GPC has to know when compiling a module whether there will be an implementation part (because it has to create the initializer if (and only if) not).
It also seems reasonable to me from the programmer's point of view. When you write a module interface, you know whether there has to be an implementation (namely, if there are any routines in the interface or an initializer or finalizer will be needed) or not (only constants, types and variables without need for initialization/finalization). So it makes sense to specify this explicitly (by writing `interface' or not).
Can anyone confirm my interpretation?
Frank