Page Numbers: Yes X: 306 Y: 1.0" First Page: 1 Not-on-first-page
Margins: Top: 1.0" Bottom: 1.0"
Heading:
CS-370 (FALL 1982)3-LISP REFERENCE MANUALNovember 3, 1982
———————————————————
Control Flow in the Reflective Processor
———————————————————
Tail recursive positions within procedure bodies are underlined; continuations are in a different face (italic, bold, or italic-bold).
———————————————————————————————————————————
𔁇(define NORMALISE
𔁈(lambda simple [exp env cont]
𔁉(cond [(normal exp) (cont exp)]
𔁊[(atom exp) (cont (binding exp env))]
𔁋[(rail exp) (normalise-rail exp env cont)]
𔁌[(pair exp) (reduce (car exp) (cdr exp) env cont)])))
𔁍(define REDUCE
𔁎(lambda simple [proc args env cont]
𔁏(normalise proc env
10(lambda simple [proc!]; Continuation C0
11(if (reflective proc!)
12 ((de-reflect proc!) args env cont)
13 (normalise args env
14 (lambda simple [args!]; Continuation C1
15 (if (primitive proc!)
16 (cont ↑(proc! . args!))
17 (normalise (body proc!)
18 (bind (pattern proc!) args! (cenv proc!))
19 cont)))))))))
20(define NORMALISE-RAIL
21(lambda simple [rail env cont]
22(if (empty rail)
23 (cont (rcons))
24 (normalise (1st rail) env
25 (lambda simple [first!]; Continuation C2
26 (normalise-rail (rest rail) env
27 (lambda simple [rest!]; Continuation C3
28 (cont (prep first! rest!)))))))))
———————————————————————————————————————————
29(define READ-NORMALISE-PRINT
30(lambda simple [level env stream]
31(block (prompt level)
32 (map (lambda simple [form!] (reply form! stream))
33 (normalise (read stream) env id*))
34 (read-normalise-print level env stream))))
———————————————————————————————————————————













<==<figure-3-manual-03.press<