Scott Moore wrote:
I have been working on personally certifying the compliance of several ISO 7185 compilers this last week. You all are no doubt aware that the ISO 7185 specifies header parameters such as:
program test(input, output, file1, file2);
...
Although ISO 7185 does not specify the mechanisim, most implementors have given a means to connect the header parameter files to external, named files, including the original Wirth implementation of Pascal on the CDC 6000 computer.
[...]
However, I also note that GPC does not provide a means to automatically connect these files, but requires operator intervention to do this. I wonder if I could talk you guys into implementing a slight enhancement to GPC, that is completely compatible with your present methodology ?
Thanks for your comments. Actually GPC supports a way, but it's not very well documented:
foo --gpc-rts=-nfile1:thisfile --gpc-rts=-nfile2:thatfile
Yes, I know, it looks strange, but that's intentional, so it doesn't easily conflict with other uses of command line parameters. (Of your examples, it might be closest to Compaq Pascal.)
For GPC, to keep compatibility with your present methods, I would suggest:
If a program parameter file is present, and it can also be determined that a command line argument exists for it, then get that from the command line instead of prompting the user. This continues for as many parameters as exist in the program header.
Altogether GPC has 6 ways (unless I'm missing some ;-) of connecting file variables to file names (the latter 3 are for program parameters, the first 3 are also for other file variables -- they can, of course, use the command line parameters, using non-standard Borland extensions ParamCount, ParamStr).
1. Additional parameter to Reset/Rewrite/...
2. Bindings (Extended Pascal)
3. `Assign' (Borland Pascal)
4. Asking the user (as you mentioned)
5. `--gpc-rts=-n...'
6. `--transparent-file-names' (compile time option, causes file names to correspond to variable names; was added on user request)
Given this, it might not matter much to add a 7th way, if it's still deemed necessary. (It should not be very difficult to implement.) I myself am neutral on this, since in my own programs I'll use the programmatic ways (#1 - #3) anyway.
Frank