Exercise 5.24. Implement cond as a new basic special form without reducing it to if. You will have to construct a loop that tests the predicates of successive cond clauses until you find one that is true, and then use ev-sequence to evaluate the actions of the clause. ———————————————————————————————————————————————————————————————————————— ev-cond (assign unev (op cond-clauses) (reg exp)) ev-cond-loop (test (op empty-cond-expr?) (reg unev)) (branch (label ev-cond-empty)) (save env) (assign exp (op first-cond-clause) (reg unev)) (assign unev (op rest-of-cond-clauses) (reg unev)) (save unev) ; save the rest of the clauses (save exp) ; save this entire clause (assign exp (op cond-clause-predicate) (reg exp)) ; extract the predicate (save continue) (assign continue (label ev-cond-after-predicate)) (goto (label eval-dispatch)) ev-cond-empty (assign val (const #f)) (goto (reg continue)) ev-cond-after-predicate (restore continue) (restore exp) (restore unev) (restore env) (test (op true?) (reg val)) (branch (label ev-cond-pred-true)) (goto (label ev-cond-loop)) ev-cond-pred-true (assign exp (op cond-clause-sequence) (reg exp)) (goto (label eval-dispatch))