dwayne@rover.bsd.uchicago.edu (02/25/89)
What's wrong with the way VAX Pascal uses modules. It's terribly easy to use and it's very powerful. In the program that you are writing, you properly declare your procedures near the beginning of the program with the 'extern' qualifier. This tells the compiler to check each occurrence of the thing in your program, and to check the types also. For example: PROGRAM TEST (INPUT,OUTPUT); CONST... TYPE... VAR Y: INTEGER; PROCEDURE WHATEVER(VAR:X:INTEGER);EXTERN; BEGIN . WHATEVER(Y); . END. At somepoint you create another file somewhere called a module. It looks like: MODULE MISCFNS (anyname) (INPUT,OUTPUT); [GLOBAL] PROCEDURE WHATEVER(VAR X:INTEGER); BEGIN . . END; END. IF BOTH THE PROGRAM IS COMPILED AND THEN THE MODULE(S) ARE COMPILED... WITHOUT ERROR OF COURSE, THEN YOU JUST LINK THEM: LINK WHATEVER,MISCFNS THEN THE VAX LINKER RESOLVES THE REFERENCES AND PRODUCES THE WHATEVER.EXE FILE. THIS MAKES IT TERRIBLY CONVENIENT TO MAKE, FOR EXAMPLE, A MODULE CONTAINING A BUNCH OF FUNCTIONS YOU LIKE TO USE. THEN WHENEVER YOU WRITE A PROGRAM THAT USES ANY OF THEM THEN JUST LINK TO THAT MODULE. LINK MYNEWPROG,MYFAVFNS THIS OF COURSE USES THE VAX LINKER WHICH LINKS PROGRAMS AND MODULES REGARDLESS OF THEIR NATIVE LANGUAGE (FOR EXAMPLE A C PROGRAM WITH FORTRAN AND PASCAL FNS IF YOU LIKE). BUT THE STANDARD COULD REQUIRE THE COMPILER TO PRODUCE CROSS-REFERENCE TABLES OF UNFULFILLED REFERENCES. AND ALSO REQUIRE SOME STANDARD LINKING PROTOCOL THAT TAKES THESE COMPILED OBJECT CODE FILES AND RESOLVES THEM INTO EXECUTABLES. DWAYNE SPRADLIN DWAYNE@ROVER.BSD.UCHICAGO.EDU
corbett@ernie.Berkeley.EDU (Robert Corbett) (02/26/89)
In article <1997@tank.uchicago.edu> dwayne@rover.bsd.uchicago.edu writes: >What's wrong with the way VAX Pascal uses modules. It's terribly easy to >use and it's very powerful. There is nothing wrong with the way VAX Pascal uses modules. However, the module mechanism the ANSI/IEEE JPC put in Extended Pascal is different and cannot be implemented in a similar way. Since I am trying to implement Extended Pascal rather than VAX Pascal, I cannot use the VAX scheme. Yours truly, Bob Corbett uunet!elxsi!corbett ucbvax!sun!elxsi!corbett
amull@Morgan.COM (Andrew P. Mullhaupt) (12/17/89)
I have finally gotten a copy of the dPANS for Extended Pascal. This language, while not the ultimate answer to every need I could ever imagine, looks very useful. Does anyone provide a compiler for this language in UNIX, OS/2, DOS or MVS? I have been informed that there is some interest in the gnu Pascal compiler supporting this standard, but I would like to know if there are existing implementations. Beta testing is also of interest. Later, Andrew Mullhaupt