388 lines
83 KiB
Plaintext
388 lines
83 KiB
Plaintext
INTERLISP-D REFERENCE MANUAL
|
||
COMPILER
|
||
|
||
"18"18. COMPILER
|
||
2
|
||
|
||
The compiler is contained in the standard Medley system. It may be used to compile functions defined in Medley, or to compile definitions stored in a file. The resulting compiled code may be stored as it is compiled, so as to be available for immediate use, or it may be written onto a file for subsequent loading.
|
||
The most common way to use the compiler is to use one of the file package functions, such as MAKEFILE (Chapter 17), which automatically updates source files, and produces compiled versions. However, it is also possible to compile individual functions defined in Medley, by directly calling the compiler using functions such as COMPILE. No matter how the compiler is called, the function COMPSET is called which asks you certain questions concerning the compilation. (COMPSET sets the free variables LAPFLG, STRF, SVFLG, LCFIL and LSTFIL which determine various modes of operation.) Those that can be answered "yes" or "no" can be answered with YES, Y, or T for "yes"; and NO, N, or NIL for "no". The questions are:
|
||
LISTING? This asks whether to generate a listing of the compiled code. The LAP and machine code are usually not of interest but can be helpful in debugging macros. Possible answers are:
|
||
1 Prints output of pass 1, the LAP macro code
|
||
2 Prints output of pass 2, the machine code
|
||
YES Prints output of both passes
|
||
NO Prints no listings
|
||
The variable LAPFLG is set to the answer.
|
||
FILE: This question (which only appears if the answer to LISTING? is affirmative) ask where the compiled code listing(s) should be written. Answering T will print the listings at the terminal. The variable LSTFIL is set to the answer.
|
||
REDEFINE? This question asks whether the functions compiled should be redefined to their compiled definitions. If this is answered YES, the compiled code is stored and the function definition changed, otherwise the function definition remains unchanged.
|
||
The compiler does not respect the value of DFNFLG (Chapter 10) when it redefines functions to their compiled definitions. Therefore, if you set DFNFLG to PROP to completely avoid inadvertantly redefining something in your running system, you must not answer YES to this question.
|
||
The variable STRF is set to T (if this is answered YES) or NIL.
|
||
SAVE EXPRS? This question asks whether the original defining EXPRs of functions should be saved. If answered YES, then before redefining a function to its compiled definition, the EXPR definition is saved on the property list of the function name. Otherwise they are discarded.
|
||
It is very useful to save the EXPR definitions, just in case the compiled function needs to be changed. The editing functions will retrieve this saved definition if it exists, rather than reading from a source file.
|
||
The variable SVFLG is set to T (if this is answered YES) or NIL.
|
||
OUTPUT FILE? This question asks whether (and where) the compiled definitions should be written into a file for later loading. If you answer with the name of a file, that file will be used. If you answer Y or YES, you will be asked the name of the file. If the file named is already open, it will continue to be used. If you answer T or TTY:, the output will be typed on the teletype (not particularly useful). If you answer N, NO, or NIL, output will not be done.
|
||
The variable LCFIL is set to the name of the file.
|
||
To make answering these questions easier, there are four other possible answers to the LISTING? question, which specify common compiling modes:
|
||
S Same as last setting. Uses the same answers to compiler questions as given for the last compilation.
|
||
F Compile to File, without redefining functions.
|
||
ST STore new definitions, saving EXPR definitions.
|
||
STF STore new definitions; Forget EXPR definitions.
|
||
Implicit in these answers are the answers to the questions on disposition of compiled code and EXPR definitions, so the questions REDEFINE? and SAVE EXPRS? would not be asked if these answers were given. OUTPUT FILE? would still be asked, however. For example:
|
||
ÿÿ |