A function f evaluated at x internally is represented as {} (f, x);
A function application is a new operation. It has a little different properties compared to * and +, for example it is true that
(f+g){} x:= f{}x+g{}x
but it is not true that
f{}(x+y):=f{}x+f{}y
(if this were true, f would be called an additive function).
But you said the input didn't need to be compatible with LaTeX |
Oops, you are right. It is not necessary that it be compatible with LaTeX. But I want it nonetheless :)
[Edit:]
However, the output of the calculator must also be a valid input of the calculator (this is just common sense). I can make a relaxed input, and then add all the "stricter" syntax in the output. This I guess is in the right spirit of relaxed syntax. For example, the calculator accepts
3*-4
[Edit:]and so does c++!
if you must have implicit multiplication |
This is entirely a matter of taste. I prefer implicit multiplication and explicit function application to explicit multiplication and implicit function application (I guess what you are suggesting). It is easily doable however. Most math texts do not write * for multiplication as opposed to computer science texts.
Also, I don't get the difference between {{x}} and x |
This is an idea I learned from Mathematica, perhaps the most brilliant idea of that program.
{{x}}
translates one to one to the Mathematica
x_
.
The{{}} operation is used to denote substitution (pattern) rules. {{x}} is a local variable, valid only for the duration of the current command it resides in. The first letter enclosed in {{}} becomes "dummy" variable. Any further encounter of that letter in the same command, even if not enclosed in {{}}, is automatically considered to be enclosed in {{}}. For example,
is the same as
A dummy variable should not be used outside of
the left side of (something := something ) expression. A dummy variable denotes the "-any expression matches me-" pattern. That is, if you say
,
you are saying "(AnyExpression) should be substituted by (AnyExpression +1)". Of course, this will set the calculator on an "infinite cycle". Here is that exact example:
http://cartan.math.umb.edu/vpf/cgi-bin/symbolicCalculator?in1=%7B%7Ba%7D%7D%3A%3Da%2B1%3B%0D%0Ax
For example, the pattern {{x}}^({{a}}+{{x}}) would match b^{c+b} (with {{x}}=b and {{a}}=c), would match b^{b+b} (with {{x}}=b and {{a}}=b), but would not match b^{c+d}.