I would like to achieve a function sin
as in:
T=Sin[t];
sin[x_]:=T/.t->x;
But without this replacement rule. How can I tell Mathematica plug in the definition of the variable first before defining the function?
I want Mathematica to treat T
exactly as if I used Sin[t]
. How can I achieve that?
T[t_] = Sin[t];
thenT[x]
evaluates toSin[x]
$\endgroup$T
as if i copy pasted the expressionT
stands for. I dont wantT
to be another function $\endgroup$T = Sin[t]; sin[t_] = T;
thensin[x]
evaluates toSin[x]
$\endgroup$T
also in environments likesin=Function[t,T]
$\endgroup$Function
has the attributeHoldAll
you would need to usesin = Function[t, Evaluate@T]
$\endgroup$