Do any of the Fortran variants support "symbolic variables"? That is to say, variables used by the compiler at compile time. They are not part of the program but used to direct the compiler. They are called various things: compiler variables, macro variables, symbolic variables.
In S/360 assembler you can state:
ABC EQU 321
This causes the text string "321" to be associated with the label "ABC". So when the assembler sees ABC it replaces it with 321. So saying L 5,ABC loads the contents of location 321 into register 5. Similarly, CL&ABC is the same as saying CL321. (& is the concat symbol)
In Fortran type languages it is nice for specifying sizes of arrays and DO loop limits.
%LET AMAX=100 [this is a SAS construct]
DIMENSION MYARRAY(AMAX)
DO 500 I=1, AMAX
MYARRAY = 0.0
500 CONTINUE
This code would result in allocating a REAL array of 100 elements and then zeroing it out. Any place in the code where I use AMAX by itself or concatenated via the concat symbol the compiler just does the substitution. Very similar to macro generated code.
Hope I didn't talk too much. Anybody familiar with type of symbolic coding?
Bruce.
In S/360 assembler you can state:
ABC EQU 321
This causes the text string "321" to be associated with the label "ABC". So when the assembler sees ABC it replaces it with 321. So saying L 5,ABC loads the contents of location 321 into register 5. Similarly, CL&ABC is the same as saying CL321. (& is the concat symbol)
In Fortran type languages it is nice for specifying sizes of arrays and DO loop limits.
%LET AMAX=100 [this is a SAS construct]
DIMENSION MYARRAY(AMAX)
DO 500 I=1, AMAX
MYARRAY = 0.0
500 CONTINUE
This code would result in allocating a REAL array of 100 elements and then zeroing it out. Any place in the code where I use AMAX by itself or concatenated via the concat symbol the compiler just does the substitution. Very similar to macro generated code.
Hope I didn't talk too much. Anybody familiar with type of symbolic coding?
Bruce.