I wish to define a function, which accepts either functions or constants as arguments. I tried
g[t_, y_] := Module[{}, t[y]]
which simply evaluates some function t
at y
.
Now if I run
t[x_] = 300
g[t, y]
the module g
simply returns 300. However if I run
g[300, y]
it returns:
300[y]
How do I define g
in such a way that it accepts either functions or constants as arguments?