quired are computed. Ho w ev er, problems arise in the compilation of recursiv e

functions.

In general (w e shall discuss an exception), the routine for a recursiv e func-

tion uses itself as a subroutine. F or example, the program for su bst [ x ; y ; z ] uses

itself as a subroutine to ev aluate the result of substituting in to the sub expres-

sions car [ z ] and cdr [ z ]. While subst [ x ; y ; cdr [ z ]] is b eing ev aluated, the result

of the previous ev aluation o f su bst [ x ; y ; car [ z ]] mus t b e sa v ed in a temp orary

storage register. Ho w ev er, s ubst may need the same register for ev aluating

subst [ x ; y ; cdr [ z ]]. This po ssible conﬂic t is resolv ed by the SA VE and UN-

SA VE r o utines that use the public push-down list

8

. The SA VE routine is

en tered at the b eginning of the ro utine for the recursiv e function with a re-

quest to sav e a given set o f consecutiv e registers. A blo c k of registers called

the public push-down lis t is reserv ed for this purp ose. The SA VE r o utine has

an index that tells it how many registers in the push-do wn list are already

in use. It mov es the con ten ts of the registers whic h are to b e sav ed to the

ﬁrst un used registers in the push-do wn lis t, a dv ances the inde x of the list, and

returns to the program from whic h con trol came. This program may then

freely use these r egisters f or temp orary storage. Before the routine exits it

uses UNSA VE, whic h restores the con ten ts of the temp orary registers from

the push-do wn list and mov es back the index of this list. The result of these

con v entions is described, in programming terminology , b y sa ying that the re-

cursiv e subroutine is tra nsparent to the temp orary storage r egisters.

f. Status of the LISP Pr o gr a m ming System (F ebruary 1960). A v ariant of

the function apply describ ed in section 5f has b een translated in to a program

APPL Y for the IBM 704. Since this routine can compute v alues of S-functions

giv en their descriptions as S-expressions and their a rgumen ts, it serv es as an

in terpreter for the LISP prog r a mming language whic h describ es computation

pro cesses in this w ay .

The program APPL Y has b een im b edded in the LISP programming system

whic h has the following features:

1. The progr a mmer ma y deﬁne an y n um b er of S-functions by S-expressions .

these functions may refer to eac h other or t o certain S-functions represen ted

b y machine language program.

2. The v alues of deﬁned functions may b e computed.

3. S-expres sions ma y b e read and prin ted (directly or via magnetic tap e).

8

1995: now called a stack

29