灯下 登录
计算机科学 / SICP / 5.4.3 Conditionals, Assignments, and Definitions

Exercise 5.24 · 习题

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.

练习 5.24:将 cond 实现为一种新的基本特殊形式,而不将其归约为 if。你需要构造一个循环,依次检验各 cond 子句的谓词,直到找到一个值为真的谓词,然后用 ev-sequence 对该子句的动作求值。