MTS 8: LISP and SLIP in MTS
June 1976
for arrays.
An atom may also be declared to be an array name with the
following declaration:
(DECLARE H =ARRAY)
Interpreter functions which are N-type or F-type functions are
already declared correctly within the compiler.
Number Types
The LISP compiler assumes that no floating point numbers will
ever be generated, and therefore compiles all numeric calcula-
tions to perform integer arithmetic.
The user can change this assumption with the declaration:
(DECLARE =SYSFLAG =INTEGERS NIL)
in which case all functions that allow floating-point argu-
ments will be compiled as calls to the interpreter.
Block Compiling
Within a compiled program, any internal LAMBDA-expression is
defined to be a separate "block," and each compiled program
consists of one primary block and zero or more secondary
blocks.
In addition, external functions which are defined as LAMBDA-
expressions may be declared to be "macros," and the compiler
will replace the function name with the LAMBDA definition, and
compile the LAMBDA-expression as an internal block.
The important property of an internal block is that it has
access to the local variables defined in the block which
called it (and all higher blocks).
For example, suppose function A calls function B, and
(DECLARE B =MACRO)
was in effect when A was compiled. Then the SUBR code for A
contains a compiled "copy" of B. If X is a local variable
within A, all free references to X within the copy of B will
refer to that local variable.
The number of blocks compiled and the length (in bytes) of
code produced for each block may be obtained via a printed map
on LISPOUT by setting the variable =MAP to T before compiling.
84 LISP

MTS 8: LISP and SLIP in MTS
June 1976 Page Revised January 1983
The Fixed-Link Option
The linkage from a compiled function to another compiled
function that it calls, or an array that it accesses, may be
declared to be "fixed-linked" (=FL), provided that the defini-
tion of the called function or array will not change after the
first time it is accessed by the calling function.
The first time the =FL call is executed, the pointer to the
atom that is the =FL function or array name is replaced by a
pointer to the actual SUBR code or array area. This replace-
ment eliminates the property-list search of the function or
array name on all subsequent executions of the call.
A function or array is declared to be fixed-linked as follows:
(DECLARE F =FL)
If, on the first execution of a =FL linkage, the system cannot
find a SUBR property, or if STATUS code 48 is set to NIL, the
system uses a normal linkage, and the =FL declaration is
ignored for that call.
Setting the variable =FL to T causes all function and array
references to be compiled as fixed-linked, unless the function
or array has been declared =SL as follows:
(DECLARE F =SL)
Note: Only compiled functions and arrays may be declared =FL.
Note: It is virtually impossible to debug a large LISP system
that is heavily fixed-linked, since =FL calls do not generate
any evidence on the stack, or in the trace-back. When an
error occurs, the user has no way to determine which of his
=FL functions was being executed. Therefore, when compiling a
large system, the following procedure is recommended:
(1) Compile all functions with =FL declarations in their
final form.
(2) Excise the compiler.
(3) CHECKPOINT the system before performing any execu-
tions. The =FL linkages will not yet be resolved.
(4) Set STATUS code 48 to NIL to suppress completion of
fixed links.
(5) Test the system thoroughly.
(6) RESTORE the original unexecuted system, set STATUS
code 48 to T, and proceed.
The =CHECK Option
If a function has been declared to be a =CHECK function as
follows
LISP 85
Previous Page Next Page