I think this is cleaner:
chosenFun =
Switch[
param,
1, fun1,
2, fun2,
3, fun3,
_, Null]
You would do something more appropriate than just Null
in the fall-through case. If
, Switch
, and Which
are special forms that hold their arguments unevaluated, so you don't need to worry about unexpected evaluation as a side-effect.
But, another way to view this is as a parameterization to your function, like Hans suggested. An alternate way to do that would be:
newFun[1] = fun1;
newFun[2] = fun2;
newFun[3] = fun3;
And now you can just use:
newFun[param][x]