File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change
1
+
2
+ (define (list-of-values-left-to-right exps env )
3
+ (if (null? exps)
4
+ '()
5
+ (let ((first-value (seck-eval (first-operand exps) env)))
6
+ (cons first-value
7
+ (list-of-values-left-to-right (rest-operands exps) env)))))
8
+
9
+ ; ; right-to-left is just the same
Original file line number Diff line number Diff line change 16
16
((cond? exp) (seck-eval (cond->if exp) env))
17
17
((application? exp)
18
18
(seck-apply (seck-eval (operator exp) env)
19
- (list-of-values (operand exp) env)))))
20
-
19
+ (list-of-values (operand exp) env)))
20
+ (else
21
+ (error 'seck-eval " eval failed to recognize expression" exp))))
21
22
22
23
; @(tools)
23
24
(define (tagged-list? exp tag )
321
322
(define (operand exp ) (cdr exp))
322
323
(define (first-operand exps ) (car exps))
323
324
(define (rest-operands exps ) (cdr exps))
325
+ ; fetch a list of values, eval them and return results as list
324
326
(define (list-of-values exps env )
325
327
(if (null? exps)
326
328
'()
You can’t perform that action at this time.
0 commit comments