1. Yes, I know those circumventions are possible, but the computer should adapt to the user, not vice verca.
The user should not have to remember to add an extra space after a minus sign.

2. (a+b)(c+d) does work fine. In some situations the parentheses surrounding the expression don't show when they should, so I'll have to tweak that.

x(a+b) isn't allowed because x() is handled like a function. Graphing calculators have the same problem. The only way I can see to allow that is to differentiate between functions and variables at run-time, which means pre-defining the names of each before using them.

I might be able to tweak minus signs to work correctly in situations. Graphing calculators solve this problem by having a different minus sign than their negative sign. Anyone have any ideas for rules regarding the dash? (ie: if letter before and afterwards, it's a minus sign)

3. Wouldn't it always be possible to interpret it as a negative sign?

4-n = 4+(-n)

4. Originally posted by XSquared
Wouldn't it always be possible to interpret it as a negative sign?

4-n = 4+(-n)
But that could also be
4-n = 4(-n)

5. Most people would probably write that as 4*-n though, or use 4(-n). I don't think anyone would type 4-n and intend 4 times negative n.

edit: impressive program anyway

6. so... ignoring whitespace, it's a minus sign unless
1) It's preceded by a plus sign
2) it's preceded by a parenthesis
3) it's the first character in the string
4) it's preceded by a '*'

This sound good?