Add missing code for 4.1

This commit is contained in:
Oliver Payne 2023-08-13 22:30:21 +01:00
parent e98e2cb924
commit c6ccffce8a
1 changed files with 29 additions and 0 deletions

29
4_1.rkt Normal file
View File

@ -0,0 +1,29 @@
#lang sicp
(define (list-of-values-lr exps env)
(if (no-operands? exps)
'()
(let* ((first (eval (first-operand exps) env))
(rest (list-of-values (rest-operands exps) env)))
(cons first rest))))
(#%require (only racket/trace trace-define))
(trace-define (list-of-values-rl exps env)
(if (no-operands? exps)
'()
(let* ((rest (list-of-values (rest-operands exps) env))
(first (eval (first-operand exps) env)))
(cons first rest))))
(define list-of-values list-of-values-rl)
(#%require (all-except "ch4-mceval.rkt" list-of-values))
(#%require (only racket/base module+))
(module+ main
(define the-global-environment (setup-environment))
(driver-loop)
)