Sussman and Steele | December 22, 1975 | 33 | Implementation of the Interpreter |
(DEFUN RESTORE () (PROG (TEMP) (SETQ TEMP (OR **CLINK** (ERROR '|PROCESS RAN OUT - RESTORE| **EXP** 'FAIL-ACT)) **EXP** (CAR TEMP) TEMP (CDR TEMP) **UNEVLIS** (CAR TEMP) TEMP (CDR TEMP) **ENV** (CAR TEMP) TEMP (CDR TEMP) **EVLIS** (CAR TEMP) TEMP (CDR TEMP) **PC** (CAR TEMP) TEMP (CDR TEMP) **CLINK** (CAR TEMP))))
This is the central function of the SCHEME interpreter. This "instruction" expects **EXP**
to contain an expression to evaluate, and **ENV**
to contain the environment for the evaluation. The fact that we have arrived here indicates that **PC**
contains 'AEVAL
, and so we need not change **PC**
if the next instruction is also to be AEVAL
. Besides the obvious objects likes numbers, identifiers, LAMBDA
expressions, and BETA
expressions (closures), there are also several other objects of interest. There are primitive operators (LISP functions); AINT
s (which are to SCHEME as FSUBR
s like COND
are to LISP); and AMACRO
s, which are used to implement DO
, AND
, OR
, COND
, BLOCK
, etc.