Chapter 4, Metalinguistic Abstraction
Exercise 4.1
Left to right irrespective of the implmenting language order:
1
2
3
4
5
6
(define (list-of-values exps env)
(if (no-operands? exps)
'()
(let ((first (eval (first-operand exps) env)))
(let ((remaining (list-of-values (rest-operands exps) env)))
(cons first remaining)))))
Right to left irrespective of the implementing language order:
1
2
3
4
5
6
(define (list-of-values exps env)
(if (no-operands? exps)
'()
(let ((remaining (list-of-values (rest-operands exps) env)))
(let ((first (eval (first-operand exps) env)))
(cons first remaining)))))
Well, this can not be tested at this point as other methods are not yet implemented.