filling in the details: sequences
how sequences are evaluated
(define evseq (lambda (clauses env)
(cond ((null? (cdr clauses)) (mc-eval (car clauses) env))
(else (mc-eval (car clauses) env) (evseq (cdr clauses) env)))))
can you add the and special form?
- definition:
to evaluate (and e1 e2 … en)evaluate e1 to v1if v1 is false, the value is v1, else continueif all vi are true, value is vn
- code
(define evand (lambda (clauses env)
(cond ((null? (cdr clauses)) (mc-eval (car clauses) env))
((mc-eval (car clauses) env) (evand (cdr clauses) env)) (else #f)))