Is it correct that the Select
equivalent of Cases
is missing for Switch
?
I mean a function switch[conditionFunction,form1,value1,form2,value2,...]
. Where conditionFunction
would be a function that evaluates to True
or False
on the various forms, and switch would return the first value for which conditionFunction[form]
evaluates to True
.
What should I be using for this? If nothing pre-exists, what would be the best way to implement this.? (And why is this missing if we do have both Select
and Cases
by default?)
Which
is the function you're looking for. $\endgroup$