Eike Lange wrote:
In our department, we have a little conversion about Pascal-Standards:
Is the following allowed and should the program be compiled if the unit and the program share the same file? It seems, that GPC does and TurboPascal (tm) does not AFAIK.
8<---------------- unit foo;
interface ... implementation ... end.
program bar; uses foo;
begin ... end.
------------->8
Marco van de Voort wrote:
This is not defined in standards afaik,
No. In fact the standards don't say anything about source files (including file names or anything) AFAIK. (Besides, units are a BP extension, but the same question could be constructed with EP modules.)
but most compilers don't accept it. So I wouldn't use it for pure practical reasons.
Indeed, this feature might (but not sure) be dropped sometime. The original reason was that for EP modules, interface and implementation are separate entities, yet it might be convenient to put them in the same source file. But whether the generalization to allow any combination of units, modules and (at least one :-) program in a source file is so good, I'm not sure ...
Frank