I'm currently working on a math evaluator, which works by converting the infix notation to postfix notation and then evaluating the postfix expression. It was going pretty good, until I ran into the problem of unary operations and having functions accepting an infinite amount of parameters.
Say (infix notation): $$1+2*3$$
Which of course would be (postfix notation): $$1\enspace 2\enspace 3 * +$$
But how would we go about representing unary operations. Like $$4!$$ or $$-4$$ or $$not\enspace true$$
Further what about functions $sqrt(9)$ would be easy, as we know $sqrt$ only needs a single parameter. But what if the function accepts an arbitrary amount of parameters.
Thereby both (infix notation): $$f(1, 2) + 3$$ and $$1 * f(2) + 3$$
Would result in (postfix notation):
$$1\enspace 2\enspace f\enspace 3\enspace+$$
$$1\enspace 2\enspace f\enspace *\enspace 3\enspace +$$
My previous assumption here being that the function could just eat all the previous numbers, but that clearly isn't going to work...