On 19:15 29/05/04, Waldek Hebisch wrote:
AFAIKS there are two remaining problems:
- There is no default way to find implementation so plain `--automake' (or `gp' (alias `cgp', alias `gpmake')) can not find them. IMHO we need to introduce a convention here. I propose to have `module.p' for interface and `module-imp.p' for implementation.
That is one of my main points in my original message.
With all due respect, I propose a different system: one wherein we could tell gpc (through maybe a command-line parameter) where it could search for the sections it needs. We could then name our interfaces and implementations the same, and just store them in different directories; maybe interface/ and implementation/ directories, or something similar.
We could then, maybe, have other parameters to fine-tune the search: something like --prepend-interface-name or --append-interface-name, and --prepend-implementation-name --append-implementation-name.
This hypothetical version of gpc could then be invoked this way:
gpc myprog.pas --automake --module-interface-dir="./interface/" --module-implementation-dir="./implementation/" --append-interface-name="-interface" --append-implementation-name="-implementation"
Our hypothetical gpc would go compile myprog.pas, and when it encounters an import statement (say `import somemodule'), it goes into ./interface/ and looks for a file named `somemodule-interface.pas' to get the interface section, then goes to ./implementation/ and looks for a file named `somemodule-implementation.pas' to get the implementation.
Of course, employing such a system would have to be much more robust, considering modules don't have to be named the same as the file that contains them, and that modules can export items under a different name.
However, I believe that such a system would be much more flexible than requiring GPC users constrain themselves to having module implementations named `module-imp.pas'; no offense, Waldek. :)
(What does AFAIKS mean? I've Googled for it, but the only acronym I can find for IKS (I'm assuming AFA means As Far As) is `Imperial Klingon Ship', `Interkantonale Kontrollstelle fur Heilmittel' (which I can't decipher further than `International Something for Something'), and `Tiksi', which is Russian (or so acronymfinder.com tells me))