cond requires an even number of clauses: (cond test1 value1 test2
value2 :else default-result) with the convention being to use :else as
the last testN expression to provide a 'placeholder' for the default /
else return value.
case allows an odd number of clauses: (case expr val1 result1 val2
result2 default-result) and the case macro pulls out (last clauses) if
(odd? (count clauses)) so it's a very explicit choice.
I can see why case has to do that - no unique value could be used as a
'default' placeholder without potentially removing a valid value from
the domain of test values - but I can't see any immediate reason why
cond couldn't treat an odd number of clauses as being the default
result: (cond test1 value1 test2 value2 default-result)
Could someone explain the rationale behind this difference?
Thanx!
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/
Railo Technologies, Inc. -- http://www.getrailo.com/
"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)