pgf-tikz / pgf

A Portable Graphic Format for TeX
https://pgf-tikz.github.io/
1.08k stars 104 forks source link

Give an error when function with no argument is called with parentheses (or function with argument is called with no parentheses) in \tikzmath? #1322

Open user202729 opened 2 months ago

user202729 commented 2 months ago

Brief outline of the proposed feature

\begin{tikzpicture}
    \node{
            \tikzmath{
                function g{
                    return 2;
                };
                real \i;
                \i=g;
                print{\i};
            }
            \tikzmath{
                function f(\x){
                    return \x;
                };
                real \i;
                \i=f;
                print{\i};
            }
        };
\end{tikzpicture}

Usage example

No response