Besides the constant time dispatch of case, what could be other points leading me to use case instead of cond condp?
case semantically conveys the nature of your condition better than cond or condp.case is more concise than cond or condp.Example:
(cond
(= foo 1) :one
(= foo 2) :two
(= foo 3) :three)
(condp = foo
1 :one
2 :two
3 :three)
(case foo
1 :one
2 :two
3 :three)
I can't comment on any performance aspects, but as always, that should be the least of your considerations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With