What you call “infix macro” actually isn't. The behavior of ^
is hardwired in TeX (not the character itself, just any character with category code 7 would behave in exactly the same way); the same holds for _
(category code 8, actually).
There are “infix commands” such as \over
or \overwithdelims
, but they're not macros: they're unexpandable primitives.
The working of the above tokens is deeply based on TeX's math mode, where very different things happen with the input. Indeed, a math list is built by classifying the objects found as atoms of various types; an atom has three fields: the nucleus, the subscript and the superscript and each of these can itself be a math list.
How does \over
work? First, we note that an “alone” {
(one not used for delimiting arguments to macros) or \left
start a new math list that will be later inserted in the outer math list.
Now, when TeX finds \over
, it stores whatever it has found in the current math list (that might be the main math list), starts a new math list until coming to the matching }
or \right
(or the end of math mode) and then takes the two so built math lists and forms with them a Frac atom.
This cannot be reproduced via macros: it is a built in behavior (and one of the flaws of TeX, in my opinion).
How might your proposed ♤
operator determine what's the “left part” and “right part”? Something like \over
can, because its behavior is built in in TeX which has specific processing rules for it.
Footnote. The peculiar syntax of \over
is meant to reflect how fractions are read aloud. But what would be the meaning of “x plus one over x plus two”? Does it correspond to
\frac{x+1}{x+2}
or to
x+\frac{1}{x}+2
or to something else?
\over
are hardwired in TeX and their behavior cannot be reproduced with macros. Other than with these particular commands, infix syntax is not possible.♤{a+b}{c+d}
is ok, even♤ab
, but nota♤b
.