# Infix strange behaviour

Maybe this is a bug or maybe Infix acts differently than the other functions.

The fact is that both:

TreeForm[Infix[f[x, a]]]


and

ToString[Infix[f[x, a]]]


crash the kernel. I use Mathematica 9.0 and maybe there are other cases that Infix behaves strangely.

Does anybody can explain why this happens ?

-
confirmed (9.000). –  george2079 Dec 4 '13 at 19:08
I confirm this behavior for Mathematica 8.0.4 under Windows 7 x64. –  Alexey Popkov Dec 5 '13 at 7:06

Hack workaround..

infix[f_] := Infix[f, "~" <> SymbolName[Head[f]] <> "~"];
ToString[infix[f[a, b, c]]]

-> "a~f~b~f~c"

-
Nice hack to get the String , but the TreeForm seems awkward. I am parsing some mma expressions and I would like to use the embedded functions as they are. So I am still puzzled... I would like to know the real reason why Infix fails above. –  tchronis Dec 4 '13 at 19:43
Also ToString[ Hold@(Infix[f[x, a], "~" <> SymbolName[Head[f[x, a]]] <> "~"]) ] crashes the kernel. Removing Hold or replacing with HoldAll works ok ... –  tchronis Dec 4 '13 at 20:05
note this also crashes: OutputForm[Infix[f[a, b]]] -- seems like a question for Wolfram support. –  george2079 Dec 4 '13 at 20:07
Sent to Wolfram support. I will update here when they send a feedback. Thanks @george2079 –  tchronis Dec 5 '13 at 6:05