In general, it would depend upon the behaviour you are looking to achieve, since
cond ceases evaluation of subsequent test expressions upon a test expression for a condition returning a non-nil value.
Hence in general, the question of whether
cond may be used is equivalent to asking whether your
if statements could be written:
<then-expression-1>
<then-expression-2>
<then-expression-3>
...
)
)
)
The above is then equivalent to:
( <test-expression-1>
<then-expression-1>
)
( <test-expression-2>
<then-expression-2>
)
( <test-expression-3>
<then-expression-3>
)
( ... )
)
However, this question is obvious for your scenario, since the variable '
var' can only hold
one value, so this value must be
either "a", "b" or "c". Therefore, the set of consecutive
if statements could be written as a nested structure:
(do my thing)
)
(do my thing)
)
(do my thing)
)
)
)
)
Which indicates that
cond could be used instead:
( (= var "a")
(do my thing)
)
( (= var "b")
(do my thing)
)
( (= var "c")
(do my thing)
)
)