Construction of a pure function h to convert expressions to traditional notation [closed]

strong textThe use of this function h is to transform expressions into traditional form.

To use further in Complex analyse

h = Function[a, (TraditionalForm[HoldForm[a = #1]] & )[a], HoldAll];

applied for a complex function

f[z_] := Expand[z^4];

h[f[z]]

How is this pure function h made ?

• Please provide Mathematica code. Feb 9, 2022 at 15:55
• h is a pure Function with a single formal parameter \[Alpha]. Feb 9, 2022 at 15:58
• Well, you should have put a bit more effort in formatting your question. Posting a screenshot of the code without the corresponding code text is one of the worst thing to do in this site. Also, as mentioned before, you should make the question more focused, the code sample should be minimal. In this case, why not omitting the last 3 lines of code? Feb 10, 2022 at 1:39
• Then, to close voters: I don't think evaluation control in Mathematica (include but not limited to the usage of HoldAll) is simple. Feb 10, 2022 at 2:02
• ...I'd recommend spending time reviewing "Core Language" in this tutorial or in this book (esp. Ch. 2, 5, 6, 7). I think it would help you with all your questions if you had a better overall idea what Function, HoldForm, ./ w/ rules (ReplaceAll), and so forth mean, than to ask about one little bit, latch onto it, then get confused because only a partial explanation was given. Feb 10, 2022 at 17:12

To understand "h" you must realize that h contains 2 functions. The outer function has an argument: "a" and the attribute "HoldAll". Therefore, inside this function "a" is replaced by the unevaluated argument. E.g. if the argument is f[x+ I y] we will have:

Function[{a},
TraditionalForm@HoldForm[h[f[x + I y]] = #] &@h[f[x + I y]], HoldAll]


Now we have the inner function, that does not have an attribute. It therefore evaluates its argument "h[f[x + I y]" and the result is replaced inside the HoldForm:

HoldForm[h[f[x + I y]] = x^4 + 4 I x^3 y - 6 x^2 y^2 - 4 I x y^3 + y^4]


• i do see -2 Votes? this question does not show any reseach effort, it is unclear or not useful That's not true , because last two weeks when i started as new user with MMA i learned the handling in MMA with cells and more and invest time to learn more in MMA What for a research do you expect then and why it is not useful ..tell me Feb 9, 2022 at 18:49
• @janhardo you could read others' questions, and see how they organize theirs. Also, read the document carefully. Feb 9, 2022 at 19:57
• @wuyudi, good hint to look to other questions : i looked at the question mathematica.stackexchange.com/questions/75927/… Indeed i do see the style of questioning here I will try to question style into a new coming question , about a complex integral Feb 9, 2022 at 20:09
• @ Daniel Huber, thanks Thanks, in general terms the working of the function h is quite clear now. I need to study the pure function further to know how exactly the function h is defined with all the symbols in it Take this: f@expr ( prefix function on expression ) ,this expression TraditionalForm@HoldForm[ ....] for instance is difficult to understand now Feb 9, 2022 at 20:49
• No magic: TraditionalForm@HoldForm[ ....] is the same as TraditionalForm[HoldForm[ ....]] Feb 10, 2022 at 13:24