I would like to understand how Inactive and Activate function works because I'm disturbed.
If I need to inactivate a function and then re activate it how to do it ? I tried the following which doesn't work :
hh[x_] := x^2
hh[2]
4
hh = Inactive[hh]
Inactive[hh]
hh[2]
Inactive[hh][2]
hh = Activate[hh]
Inactive[hh]
hh[2]
Inactive[hh][2]
As you can see the function isn't reactivated as I would like it to be. I would like to understand why because it would help me to understand better how activate/inactivate functions work.

Inactive[hh](e.g.hh1 =Inactive[hh],Activate[hh1[2]]gives 4 as expected. – kglr Jun 27 '19 at 12:20hh = List[hh]: you'll see that Mathematica complains about recursion depth. The only reason that doesn't happen withInactiveis because of theHoldFirstattribute, but it's still not a good idea to do self-referential definitions like the one you posted. The only time you can do that is whenhhactually has a value, such as withx = 1; x = x + 1. In that case, the self-reference is broken becausexwill evaluate to its value on the r.h.s. – Sjoerd Smit Jun 27 '19 at 13:18