/* xcond - special form 'cond' */ LVAL xcond() { LVAL list,val; /* find a predicate that is true */ for (val = NIL; moreargs(); ) { /* get the next conditional */ list = nextarg(); /* evaluate the predicate part */ if (consp(list) && (val = xleval(car(list)))) { /* evaluate each expression */ for (list = cdr(list); consp(list); list = cdr(list)) val = xleval(car(list)); /* exit the loop */ break; } } /* return the value */ return (val); }