4 ms·
Except that the last condition can be T, and that's exactly the same as "else" in a more conventional language.
by gjm11 17y ago
Except that the last condition can be T, and that's exactly the same as "else" in a more conventional language.
- wglb 17y agoYes, in a way, but it happens much less often. If you leave off the final clause, then it is exactly equivalent of his rewritten example.
- gjm11 17y agoI don't think it is. The point of his rewrite is that at the end of each branch the function returns so that you don't have to remember so much to make sense of what it does. Sure, a COND that's the only (or final) form in the function that contains it has the same property, but the key thing there is that it's at the end, not that it's a COND. COND really is the same thing as if ... else if ... else ...; using that rather than IF when you have more than two branches is a good thing, for sure, but I don't see how it's good for the reason you give. Am I missing something?