The current macro definitions in
heaplang.sty favour a syntax style in which function applications use parenthesised arguments, e.g.
Following a discussion on the Iris helpdesk board, it can be argued that both the styles
fn arg have individual merits,
and that authors may wish to use either when e.g. defining their BNF syntax.
It thus makes sense to update the macros so that they support both (if possible).
An attempt at achieving this is contained in this MR.
The idea is that the macros will insert a space
Alloc e1 e2 the user should write
There are multiple ways of achieving this.
\operatorname latex style, which achieves exactly what we want (proposed by @neven)
ifthenelse along with
xstring to check if the first character of the argument is
The MR uses solution 1.
\operatorname as it does not cause aforementioned unwanted subscript behaviour.
\operatorname for consistency, as they unfold to the same thing (according to https://tex.stackexchange.com/questions/84302/what-is-the-difference-of-mathop-operatorname-and-declaremathoperator).
\NewRef change, as it is no longer enforced by
\DeclareMathOperator (this should still be done in a separate MR though).